update character

This commit is contained in:
2023-12-25 16:59:25 +01:00
parent 9894ba735e
commit 73660076e5
10 changed files with 204 additions and 103 deletions
@@ -12,3 +12,16 @@ export async function StoreNewCharacter(karakter: KarakterInputs) {
throw Error(response.statusText)
}
}
export async function UpdateCharacter(id: string, karakter: KarakterInputs) {
let response = await axios.post(`${window.location.origin}/api/Character/${id}`, karakter, {
withCredentials: true,
})
if (response.status < 300){
return response.data as string
}
else {
throw Error(response.statusText)
}
}