Skip to content

Commit ae9185f

Browse files
committed
feat: add new fields to collections
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
1 parent e3ce674 commit ae9185f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

frontend/server/repo/collectionLike.repo.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ interface LikedCollectionRow {
88
slug: string;
99
description: string;
1010
logoUrl: string | null;
11+
color: string | null;
12+
imageUrl: string | null;
1113
updatedAt: string;
1214
ownerName: string | null;
1315
ownerLogo: string | null;
@@ -19,6 +21,8 @@ export interface LikedCollection {
1921
slug: string;
2022
description: string;
2123
logoUrl: string | null;
24+
color: string | null;
25+
imageUrl: string | null;
2226
updatedAt: string;
2327
projectCount: number;
2428
owner: {
@@ -73,7 +77,7 @@ export class CollectionLikeRepository {
7377

7478
const [collectionsResult, countResult] = await Promise.all([
7579
this.pool.query(
76-
`SELECT c.id, c.name, c.slug, c.description, c."logoUrl", c."updatedAt",
80+
`SELECT c.id, c.name, c.slug, c.description, c."logoUrl", c.color, c."imageUrl", c."updatedAt",
7781
u."displayName" AS "ownerName", u."avatarUrl" AS "ownerLogo"
7882
FROM "collectionLikes" cl
7983
JOIN collections c ON c.id = cl."collectionId" AND c."deletedAt" IS NULL
@@ -119,6 +123,8 @@ export class CollectionLikeRepository {
119123
slug: r.slug,
120124
description: r.description,
121125
logoUrl: r.logoUrl,
126+
color: r.color,
127+
imageUrl: r.imageUrl,
122128
updatedAt: r.updatedAt,
123129
projectCount: projectCountMap.get(r.id) || 0,
124130
owner: r.ownerName

frontend/server/repo/communityCollection.repo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export interface CommunityCollection {
1111
isPrivate: boolean;
1212
ssoUserId: string;
1313
logoUrl: string | null;
14+
color: string | null;
15+
imageUrl: string | null;
1416
projects: string[];
1517
createdAt: string;
1618
updatedAt: string;

frontend/types/collection.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export interface Collection {
2929
gradient?: [string, string];
3030
type?: CollectionType;
3131
isLiked?: boolean;
32-
likeCount?: number;
3332
isPrivate?: boolean;
3433
ssoUserId?: string | null;
3534
}

0 commit comments

Comments
 (0)