feat: Implement character avatar upload and refactor character form fields and API calls.

This commit is contained in:
liqupan
2026-02-02 22:48:11 +08:00
parent 6c32d845a7
commit dec5748cca
15 changed files with 369 additions and 197 deletions

View File

@@ -18,9 +18,7 @@ export async function getCharacters() {
export async function createCharacter(character: Omit<Character, 'id' | 'created_at' | 'updated_at'>) {
const { data, error } = await supabase
.from('characters')
.insert(character)
.select()
.single();
.insert(character);
if (error) {
throw error;
@@ -36,9 +34,7 @@ export async function updateCharacter(character: Character) {
const { data, error } = await supabase
.from('characters')
.update(updates)
.eq('id', id)
.select()
.single();
.eq('id', id);
if (error) {
throw error;