mirror of
https://github.com/ArthurDanjou/artagents.git
synced 2026-01-31 20:28:09 +01:00
lint code
This commit is contained in:
@@ -10,7 +10,8 @@ export async function loadChat(slug: string): Promise<Message[]> {
|
||||
const data = await $fetch<string>(`/api/chats/${slug}`)
|
||||
const dataString = JSON.stringify(data)
|
||||
|
||||
if (dataString === '[]') return []
|
||||
if (dataString === '[]')
|
||||
return []
|
||||
return JSON.parse(dataString)
|
||||
}
|
||||
|
||||
@@ -20,14 +21,14 @@ async function createChat(slug: string) {
|
||||
body: {
|
||||
file: {
|
||||
name: `${slug}.json`,
|
||||
content: '[]'
|
||||
}
|
||||
}
|
||||
content: '[]',
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export async function deleteChat(slug: string) {
|
||||
await $fetch(`/api/chats/${slug}.json`, {
|
||||
method: 'DELETE'
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user