From 7653ee6e172c83e9537bf5b5a7426e2f84d44132 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Wed, 1 Oct 2025 18:22:53 +0200 Subject: [PATCH] feat(web): add CommunityGallery interface and collection type Add CommunityGallery interface for the community_gallery collection view. Add "added_to_collection" status to Submission type. Extend TypedPocketBase interface to include strongly-typed community_gallery collection --- web/src/lib/pb.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/web/src/lib/pb.ts b/web/src/lib/pb.ts index be9aa425..311f70b8 100644 --- a/web/src/lib/pb.ts +++ b/web/src/lib/pb.ts @@ -15,7 +15,7 @@ export interface Submission { name: string assets: string[] created_by: string - status: 'approved' | 'rejected' | 'pending' + status: 'approved' | 'rejected' | 'pending' | 'added_to_collection' approved_by: string expand: { created_by: User @@ -38,10 +38,34 @@ export interface Submission { updated: string } +export interface CommunityGallery { + id: string + name: string + created_by: string + status: 'approved' | 'rejected' | 'pending' | 'added_to_collection' + assets: string[] + created: string + updated: string + extras: { + aliases: string[] + categories: string[] + base?: string + colors?: { + dark?: string + light?: string + } + wordmark?: { + dark?: string + light?: string + } + } +} + interface TypedPocketBase extends PocketBase { collection(idOrName: string): RecordService // default fallback for any other collection collection(idOrName: 'users'): RecordService collection(idOrName: 'submissions'): RecordService + collection(idOrName: 'community_gallery'): RecordService } export const pb = new PocketBase('http://127.0.0.1:8090') as TypedPocketBase;