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,7 +376,7 @@ export const PartySchemaRaw = z.object({
|
||||||
skill3_id: z.string().nullish(),
|
skill3_id: z.string().nullish(),
|
||||||
job_skills: z.union([
|
job_skills: z.union([
|
||||||
z.array(z.any()),
|
z.array(z.any()),
|
||||||
z.record(z.any())
|
z.record(z.string(), z.any())
|
||||||
]).nullish().default([]),
|
]).nullish().default([]),
|
||||||
accessory_id: z.string().nullish(),
|
accessory_id: z.string().nullish(),
|
||||||
accessory: JobAccessorySchema.nullish(),
|
accessory: JobAccessorySchema.nullish(),
|
||||||
|
|
@ -387,7 +387,7 @@ export const PartySchemaRaw = z.object({
|
||||||
guidebook3_id: z.string().nullish(),
|
guidebook3_id: z.string().nullish(),
|
||||||
guidebooks: z.union([
|
guidebooks: z.union([
|
||||||
z.array(z.any()),
|
z.array(z.any()),
|
||||||
z.record(z.any())
|
z.record(z.string(), z.any())
|
||||||
]).nullish().default([]),
|
]).nullish().default([]),
|
||||||
|
|
||||||
// Grid arrays (may be empty or contain items with missing nested data)
|
// Grid arrays (may be empty or contain items with missing nested data)
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,8 @@ export class PartyService {
|
||||||
party: Party
|
party: Party
|
||||||
editKey?: string
|
editKey?: string
|
||||||
}> {
|
}> {
|
||||||
const headers = this.buildHeaders(editKey)
|
|
||||||
const apiPayload = this.mapToApiPayload(payload)
|
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
|
// Note: Edit key handling may need to be adjusted based on how the API returns it
|
||||||
return { party, editKey: undefined }
|
return { party, editKey: undefined }
|
||||||
|
|
@ -78,9 +77,8 @@ export class PartyService {
|
||||||
* Update party details
|
* Update party details
|
||||||
*/
|
*/
|
||||||
async update(id: string, payload: PartyUpdatePayload, editKey?: string): Promise<Party> {
|
async update(id: string, payload: PartyUpdatePayload, editKey?: string): Promise<Party> {
|
||||||
const headers = this.buildHeaders(editKey)
|
|
||||||
const apiPayload = this.mapToApiPayload(payload)
|
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,
|
guidebookId: string | null,
|
||||||
editKey?: string
|
editKey?: string
|
||||||
): Promise<Party> {
|
): Promise<Party> {
|
||||||
const headers = this.buildHeaders(editKey)
|
|
||||||
const payload: any = {}
|
const payload: any = {}
|
||||||
|
|
||||||
// Map position to guidebook1_id, guidebook2_id, guidebook3_id
|
// Map position to guidebook1_id, guidebook2_id, guidebook3_id
|
||||||
|
|
@ -100,7 +97,7 @@ export class PartyService {
|
||||||
payload[`guidebook${position + 1}Id`] = guidebookId
|
payload[`guidebook${position + 1}Id`] = guidebookId
|
||||||
}
|
}
|
||||||
|
|
||||||
return partyAdapter.update({ shortcode: id, ...payload }, headers)
|
return partyAdapter.update({ shortcode: id, ...payload })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -110,8 +107,7 @@ export class PartyService {
|
||||||
party: Party
|
party: Party
|
||||||
editKey?: string
|
editKey?: string
|
||||||
}> {
|
}> {
|
||||||
const headers = this.buildHeaders(editKey)
|
const party = await partyAdapter.remix(shortcode)
|
||||||
const party = await partyAdapter.remix(shortcode, headers)
|
|
||||||
|
|
||||||
// Note: Edit key handling may need to be adjusted
|
// Note: Edit key handling may need to be adjusted
|
||||||
return { party, editKey: undefined }
|
return { party, editKey: undefined }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue