Fixed Pagination & modles #14

Merged
fenpaws merged 6 commits from develop/orchestrator-fixes into main 2024-07-16 11:14:09 +00:00
Showing only changes of commit c3ca361506 - Show all commits

View File

@ -252,7 +252,7 @@ func GetUserFavoriteWithPagination(ctx context.Context, db *gorm.DB, anthroveUse
for _, userFavorite := range userFavorites { for _, userFavorite := range userFavorites {
var post models.Post var post models.Post
err = db.WithContext(ctx).Model(&models.Post{}).Where("id = ?", userFavorite.PostID).First(&post).Error err = db.WithContext(ctx).Model(&models.Post{}).Joins("References").Where("id = ?", userFavorite.PostID).First(&post).Error
if err != nil { if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) { if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, &otterError.NoDataFound{} return nil, &otterError.NoDataFound{}