diff --git a/server/backend/movie.go b/server/backend/movie.go index f9095ac3..7c029804 100644 --- a/server/backend/movie.go +++ b/server/backend/movie.go @@ -15,7 +15,7 @@ func (s *CampusServer) ListMovies(ctx context.Context, req *pb.ListMoviesRequest var movies []model.Kino tx := s.db.WithContext(ctx).Joins("File") if req.OldestDateAt.GetSeconds() != 0 || req.OldestDateAt.GetNanos() != 0 { - tx = tx.Where("src > ?", req.OldestDateAt) + tx = tx.Where("date > ?", req.OldestDateAt.AsTime()) } if err := tx.Find(&movies, "kino > ?", req.LastId).Error; err != nil { log.WithError(err).Error("Error while fetching movies from database") diff --git a/server/backend/news.go b/server/backend/news.go index a2cbe1db..ee8512e6 100644 --- a/server/backend/news.go +++ b/server/backend/news.go @@ -50,7 +50,7 @@ func (s *CampusServer) ListNews(ctx context.Context, req *pb.ListNewsRequest) (* tx = tx.Where("src = ?", req.NewsSource) } if req.OldestDateAt.GetSeconds() != 0 || req.OldestDateAt.GetNanos() != 0 { - tx = tx.Where("src > ?", req.OldestDateAt) + tx = tx.Where("date > ?", req.OldestDateAt.AsTime()) } if req.LastNewsId != 0 { tx = tx.Where("news > ?", req.LastNewsId)