fix: extract arrays from API response objects
This commit is contained in:
@@ -12,11 +12,14 @@ export async function renderDashboard(app) {
|
|||||||
let selectedLibrary = app.state.selectedLibrary || null;
|
let selectedLibrary = app.state.selectedLibrary || null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[documents, libraries, tags] = await Promise.all([
|
const [docResult, libResult, tagResult] = await Promise.all([
|
||||||
api.getDocuments(),
|
api.getDocuments(),
|
||||||
api.getLibraries(),
|
api.getLibraries(),
|
||||||
api.getTags()
|
api.getTags()
|
||||||
]);
|
]);
|
||||||
|
documents = docResult.documents || [];
|
||||||
|
libraries = libResult.libraries || [];
|
||||||
|
tags = tagResult.tags || [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
app.showToast('Failed to load data', 'error');
|
app.showToast('Failed to load data', 'error');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user