소스 검색

fix: COALESCE type mismatch jsonb vs json in GetByIDWithDetails SQL

neyrogovnarik 1 개월 전
부모
커밋
a59276a75f
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      backend/internal/repository/places.go

+ 4 - 4
backend/internal/repository/places.go

@@ -67,10 +67,10 @@ func (r *PlaceRepo) GetByIDWithDetails(ctx context.Context, id string) (*models.
 		       p.cover_image, p.access_info, p.status, p.moderation_comment,
 		       p.rating, p.reviews_count, p.hourly_rate, p.currency, p.min_hours, p.booking_url,
 		       p.created_at, p.updated_at, p.published_at, p.deleted_at,
-		       COALESCE(json_agg(DISTINCT jsonb_build_object('id', t.id, 'name', t.name, 'category', t.category))
-		                FILTER (WHERE t.id IS NOT NULL), '[]'::jsonb) as tags,
-		       COALESCE(json_agg(DISTINCT jsonb_build_object('id', f.id, 'name', f.name, 'category', f.category, 'icon', f.icon))
-		                FILTER (WHERE f.id IS NOT NULL), '[]'::jsonb) as features
+	       COALESCE(json_agg(DISTINCT jsonb_build_object('id', t.id, 'name', t.name, 'category', t.category))
+	                FILTER (WHERE t.id IS NOT NULL), '[]'::json) as tags,
+	       COALESCE(json_agg(DISTINCT jsonb_build_object('id', f.id, 'name', f.name, 'category', f.category, 'icon', f.icon))
+	                FILTER (WHERE f.id IS NOT NULL), '[]'::json) as features
 		FROM places p
 		LEFT JOIN place_tags pt ON pt.place_id = p.id
 		LEFT JOIN tags t ON t.id = pt.tag_id