From 3e6749de5f4726678411dc34be08131d96e23dfc Mon Sep 17 00:00:00 2001 From: Aaron Wood Date: Sat, 11 Apr 2026 11:51:39 -0400 Subject: [PATCH] feat: extend createCharacter API to accept full character fields --- client/src/api.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/src/api.ts b/client/src/api.ts index bc91fdb..038fb66 100644 --- a/client/src/api.ts +++ b/client/src/api.ts @@ -69,10 +69,20 @@ export const joinCampaign = (token: string) => // Characters export const getCharacters = (campaignId: number) => request(`/campaigns/${campaignId}/characters`); -export const createCharacter = ( - campaignId: number, - data: { name: string; class?: string; ancestry?: string; hp_max?: number }, -) => +export interface CreateCharacterData { + name: string; + class?: string; + ancestry?: string; + alignment?: string; + background?: string; + deity?: string; + title?: string; + hp_max?: number; + gp?: number; + stats?: Record; +} + +export const createCharacter = (campaignId: number, data: CreateCharacterData) => request(`/campaigns/${campaignId}/characters`, { method: "POST", body: JSON.stringify(data),