mirror of
https://github.com/ArthurDanjou/artagents.git
synced 2026-01-28 11:00:27 +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',
|
||||
})
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ export async function streamToText(stream: ReadableStream<Uint8Array>) {
|
||||
|
||||
while (true) {
|
||||
const { done, value } = await reader.read()
|
||||
if (done) break
|
||||
if (done)
|
||||
break
|
||||
result += decoder.decode(value, { stream: true })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user