bit of cleaning, npm updated, working on character moving, typescript improvements

This commit is contained in:
2024-06-04 17:23:57 +02:00
parent 87d4313843
commit f791f1d5d8
5 changed files with 95 additions and 49 deletions

View File

@ -61,6 +61,20 @@ class CharacterRepository {
}
}
async update(character: Character): Promise<Character | null> {
try {
return await prisma.character.update({
where: {
id: character.id,
},
data: character
});
} catch (error: any) {
// Handle error
throw new Error(`Failed to update character: ${error.message}`);
}
}
async delete(id: number): Promise<Character | null> {
try {
return await prisma.character.delete({