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;
|
||||
|
||||
try {
|
||||
[documents, libraries, tags] = await Promise.all([
|
||||
const [docResult, libResult, tagResult] = await Promise.all([
|
||||
api.getDocuments(),
|
||||
api.getLibraries(),
|
||||
api.getTags()
|
||||
]);
|
||||
documents = docResult.documents || [];
|
||||
libraries = libResult.libraries || [];
|
||||
tags = tagResult.tags || [];
|
||||
} catch (e) {
|
||||
app.showToast('Failed to load data', 'error');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user