From 1990cb608ee777972c16345ef2b8a1e5aca0534c Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 16 Oct 2023 00:23:41 +0200 Subject: [PATCH] fixed `LastNewsAlertId` not working --- server/backend/news.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/backend/news.go b/server/backend/news.go index 70df92b9..bf493d57 100644 --- a/server/backend/news.go +++ b/server/backend/news.go @@ -89,7 +89,7 @@ func (s *CampusServer) ListNewsAlerts(ctx context.Context, req *pb.ListNewsAlert var res []*model.NewsAlert tx := s.db.WithContext(ctx).Joins("File").Where("news_alert.to >= NOW()") if req.LastNewsAlertId != 0 { - tx = tx.Where("news_alert.alert > ?", req.LastNewsAlertId) + tx = tx.Where("news_alert.news_alert > ?", req.LastNewsAlertId) } if err := tx.Find(&res).Error; errors.Is(err, gorm.ErrRecordNotFound) { return nil, status.Error(codes.NotFound, "no news alerts")