fix: correct function call argument counts
- party.service.ts: Remove invalid `headers` parameter from adapter calls - create(), update(), remix() methods don't accept headers parameter - party.ts schema: Add key type to z.record() calls - z.record() requires 2 arguments: z.record(keySchema, valueSchema) Fixes "Expected N arguments, but got M" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2da99a7bf8
commit
de73c1937e
2 changed files with 9 additions and 13 deletions
|
|
@ -376,18 +376,18 @@ export const PartySchemaRaw = z.object({
|
|||
skill3_id: z.string().nullish(),
|
||||
job_skills: z.union([
|
||||
z.array(z.any()),
|
||||
z.record(z.any())
|
||||
z.record(z.string(), z.any())
|
||||
]).nullish().default([]),
|
||||
accessory_id: z.string().nullish(),
|
||||
accessory: JobAccessorySchema.nullish(),
|
||||
|
||||
|
||||
// Guidebooks
|
||||
guidebook1_id: z.string().nullish(),
|
||||
guidebook2_id: z.string().nullish(),
|
||||
guidebook3_id: z.string().nullish(),
|
||||
guidebooks: z.union([
|
||||
z.array(z.any()),
|
||||
z.record(z.any())
|
||||
z.record(z.string(), z.any())
|
||||
]).nullish().default([]),
|
||||
|
||||
// Grid arrays (may be empty or contain items with missing nested data)
|
||||
|
|
|
|||
|
|
@ -66,21 +66,19 @@ export class PartyService {
|
|||
party: Party
|
||||
editKey?: string
|
||||
}> {
|
||||
const headers = this.buildHeaders(editKey)
|
||||
const apiPayload = this.mapToApiPayload(payload)
|
||||
const party = await partyAdapter.create(apiPayload, headers)
|
||||
const party = await partyAdapter.create(apiPayload)
|
||||
|
||||
// Note: Edit key handling may need to be adjusted based on how the API returns it
|
||||
return { party, editKey: undefined }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update party details
|
||||
*/
|
||||
async update(id: string, payload: PartyUpdatePayload, editKey?: string): Promise<Party> {
|
||||
const headers = this.buildHeaders(editKey)
|
||||
const apiPayload = this.mapToApiPayload(payload)
|
||||
return partyAdapter.update({ shortcode: id, ...apiPayload }, headers)
|
||||
return partyAdapter.update({ shortcode: id, ...apiPayload })
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -92,7 +90,6 @@ export class PartyService {
|
|||
guidebookId: string | null,
|
||||
editKey?: string
|
||||
): Promise<Party> {
|
||||
const headers = this.buildHeaders(editKey)
|
||||
const payload: any = {}
|
||||
|
||||
// Map position to guidebook1_id, guidebook2_id, guidebook3_id
|
||||
|
|
@ -100,9 +97,9 @@ export class PartyService {
|
|||
payload[`guidebook${position + 1}Id`] = guidebookId
|
||||
}
|
||||
|
||||
return partyAdapter.update({ shortcode: id, ...payload }, headers)
|
||||
return partyAdapter.update({ shortcode: id, ...payload })
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remix a party (create a copy)
|
||||
*/
|
||||
|
|
@ -110,8 +107,7 @@ export class PartyService {
|
|||
party: Party
|
||||
editKey?: string
|
||||
}> {
|
||||
const headers = this.buildHeaders(editKey)
|
||||
const party = await partyAdapter.remix(shortcode, headers)
|
||||
const party = await partyAdapter.remix(shortcode)
|
||||
|
||||
// Note: Edit key handling may need to be adjusted
|
||||
return { party, editKey: undefined }
|
||||
|
|
|
|||
Loading…
Reference in a new issue