diff --git a/src/lib/api/adapters/__tests__/party.adapter.test.ts b/src/lib/api/adapters/__tests__/party.adapter.test.ts index d792ab93..e56b33ce 100644 --- a/src/lib/api/adapters/__tests__/party.adapter.test.ts +++ b/src/lib/api/adapters/__tests__/party.adapter.test.ts @@ -117,13 +117,14 @@ describe('PartyAdapter', () => { }) const result = await adapter.update({ + id: 'uuid-123', shortcode: 'ABC123', name: 'Updated Party' }) expect(result).toEqual(updatedParty) expect(global.fetch).toHaveBeenCalledWith( - 'https://api.example.com/parties/ABC123', + 'https://api.example.com/parties/uuid-123', expect.objectContaining({ method: 'PATCH', body: JSON.stringify({ diff --git a/src/lib/api/adapters/party.adapter.ts b/src/lib/api/adapters/party.adapter.ts index 7aa40c5b..cc2f786a 100644 --- a/src/lib/api/adapters/party.adapter.ts +++ b/src/lib/api/adapters/party.adapter.ts @@ -21,7 +21,7 @@ export interface CreatePartyParams { description?: string | undefined visibility?: 'public' | 'private' | 'unlisted' | undefined jobId?: string | undefined - raidId?: string | undefined + raidId?: string | null | undefined guidebookId?: string | undefined extras?: Record | undefined } @@ -30,7 +30,24 @@ export interface CreatePartyParams { * Parameters for updating a party */ export interface UpdatePartyParams extends CreatePartyParams { + /** Party UUID (required for API update) */ + id: string + /** Party shortcode (for cache invalidation) */ shortcode: string + // Battle settings + fullAuto?: boolean + autoGuard?: boolean + autoSummon?: boolean + chargeAttack?: boolean + // Performance metrics (null to clear) + clearTime?: number | null + buttonCount?: number | null + chainCount?: number | null + summonCount?: number | null + // Video (null to clear) + videoUrl?: string | null + // Raid (null to clear) + raidId?: string | null } /** @@ -119,10 +136,11 @@ export class PartyAdapter extends BaseAdapter { /** * Updates a party + * Note: API expects UUID for update, not shortcode */ async update(params: UpdatePartyParams): Promise { - const { shortcode, ...updateParams } = params - const response = await this.request<{ party: Party }>(`/parties/${shortcode}`, { + const { id, shortcode, ...updateParams } = params + const response = await this.request<{ party: Party }>(`/parties/${id}`, { method: 'PATCH', body: { party: updateParams diff --git a/src/lib/api/schemas/party.ts b/src/lib/api/schemas/party.ts index 60d8507f..0f23d274 100644 --- a/src/lib/api/schemas/party.ts +++ b/src/lib/api/schemas/party.ts @@ -120,6 +120,8 @@ const MinimalScalarsSchema = z buttonCount: z.number().nullish().optional(), chainCount: z.number().nullish().optional(), turnCount: z.number().nullish().optional(), + summonCount: z.number().nullish().optional(), + videoUrl: z.string().nullish().optional(), visibility: z.enum(['public', 'private', 'unlisted']).nullish().optional() }) .partial() @@ -373,6 +375,10 @@ export const PartySchemaRaw = z.object({ button_count: z.number().nullish(), turn_count: z.number().nullish(), chain_count: z.number().nullish(), + summon_count: z.number().nullish(), + + // Video URL + video_url: z.string().nullish(), // Relations raid_id: z.string().nullish(), diff --git a/src/lib/components/sidebar/details/DetailRow.svelte b/src/lib/components/sidebar/details/DetailRow.svelte index 1c76a663..0e4d3409 100644 --- a/src/lib/components/sidebar/details/DetailRow.svelte +++ b/src/lib/components/sidebar/details/DetailRow.svelte @@ -9,12 +9,14 @@ noHover?: boolean /** Remove padding for inline edit contexts */ noPadding?: boolean + /** Remove min-width from value (for compact controls like switches) */ + compact?: boolean } - let { label, value, children, noHover = false, noPadding = false }: Props = $props() + let { label, value, children, noHover = false, noPadding = false, compact = false }: Props = $props() -
+
{label} {#if children} @@ -62,5 +64,9 @@ text-align: right; min-width: 180px; } + + &.compact .value { + min-width: unset; + } } diff --git a/src/lib/types/api/party.ts b/src/lib/types/api/party.ts index 2f5e79e7..b66d34ae 100644 --- a/src/lib/types/api/party.ts +++ b/src/lib/types/api/party.ts @@ -107,6 +107,8 @@ export interface Party { buttonCount?: number turnCount?: number chainCount?: number + summonCount?: number + videoUrl?: string visibility?: import('$lib/types/visibility').PartyVisibility element?: number favorited?: boolean