mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-13 01:32:40 +02:00
chore: ran linting
This commit is contained in:
parent
2f540ee065
commit
dbf575fbd0
23 changed files with 89 additions and 96 deletions
|
|
@ -25,17 +25,14 @@ export async function listDocuments(
|
|||
{ headers: authHeaders(token) }
|
||||
);
|
||||
if (!response.ok()) {
|
||||
throw new Error(
|
||||
`listDocuments failed (${response.status()}): ${await response.text()}`
|
||||
);
|
||||
throw new Error(`listDocuments failed (${response.status()}): ${await response.text()}`);
|
||||
}
|
||||
const body = (await response.json()) as Paginated<DocumentRow> | DocumentRow[];
|
||||
return Array.isArray(body) ? body : (body.items ?? []);
|
||||
}
|
||||
|
||||
export function isDocumentReady(doc: DocumentRow): boolean {
|
||||
const state =
|
||||
typeof doc.status === "string" ? doc.status : doc.status?.state;
|
||||
const state = typeof doc.status === "string" ? doc.status : doc.status?.state;
|
||||
return state === "ready" || state === "READY";
|
||||
}
|
||||
|
||||
|
|
@ -61,9 +58,7 @@ export async function getEditorContent(
|
|||
{ headers: authHeaders(token) }
|
||||
);
|
||||
if (!response.ok()) {
|
||||
throw new Error(
|
||||
`getEditorContent failed (${response.status()}): ${await response.text()}`
|
||||
);
|
||||
throw new Error(`getEditorContent failed (${response.status()}): ${await response.text()}`);
|
||||
}
|
||||
return (await response.json()) as EditorContent;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue