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
This commit is contained in:
Thomas Camlong
2025-10-01 18:22:53 +02:00
parent fd8b50776a
commit 7653ee6e17

View File

@@ -15,7 +15,7 @@ export interface Submission {
name: string name: string
assets: string[] assets: string[]
created_by: string created_by: string
status: 'approved' | 'rejected' | 'pending' status: 'approved' | 'rejected' | 'pending' | 'added_to_collection'
approved_by: string approved_by: string
expand: { expand: {
created_by: User created_by: User
@@ -38,10 +38,34 @@ export interface Submission {
updated: string 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 { interface TypedPocketBase extends PocketBase {
collection(idOrName: string): RecordService // default fallback for any other collection collection(idOrName: string): RecordService // default fallback for any other collection
collection(idOrName: 'users'): RecordService<User> collection(idOrName: 'users'): RecordService<User>
collection(idOrName: 'submissions'): RecordService<Submission> collection(idOrName: 'submissions'): RecordService<Submission>
collection(idOrName: 'community_gallery'): RecordService<CommunityGallery>
} }
export const pb = new PocketBase('http://127.0.0.1:8090') as TypedPocketBase; export const pb = new PocketBase('http://127.0.0.1:8090') as TypedPocketBase;