export type GetApiApiV1PhotoAlbumIdEntriesArgs = {id: number, joinPhoto?: boolean | undefined, joinPhotoAlbum?: boolean | undefined, featured?: boolean | undefined, orderBy?: ('createdAt' | 'modifiedAt') | undefined, take?: number | undefined, skip?: number | undefined, order?: ('ASC' | 'DESC') | undefined}; export type GetApiApiV1PhotoAlbumIdEntriesOptions = {baseUrl: string, LocalUserJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * 🛡️ Get photo album entries. * * GET /api/v1/photo-album/{id}/entries */ export const getApiApiV1PhotoAlbumIdEntries = async (args: GetApiApiV1PhotoAlbumIdEntriesArgs, options: GetApiApiV1PhotoAlbumIdEntriesOptions) => { const {baseUrl, fetch: fetchFn = fetch, LocalUserJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.joinPhoto != null) query.append("joinPhoto", String(args.joinPhoto)) if (args.joinPhotoAlbum != null) query.append("joinPhotoAlbum", String(args.joinPhotoAlbum)) if (args.featured != null) query.append("featured", String(args.featured)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.take != null) query.append("take", String(args.take)) if (args.skip != null) query.append("skip", String(args.skip)) if (args.order != null) query.append("order", String(args.order)) if (LocalUserJWT !== undefined) headers.set('authorization', `Bearer ${LocalUserJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/photo-album/${encodeURIComponent(String(args.id))}/entries${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };