fixed controller to include id of library without changing the schema

This commit is contained in:
Vito0912 2025-01-01 20:35:09 +01:00
parent b127f0c406
commit 00b179e6b3
No known key found for this signature in database
GPG Key ID: 29A3D509FE70B237

View File

@ -62,11 +62,8 @@ class LibraryController {
// Fetch stats for the current library
const libraryStats = await libraryHelpers.getLibraryStats(req);
// Add the libraries id to the stats
libraryStats.id = library.id;
// Add this library's stats to the array of individual stats
allStats.push(libraryStats);
allStats.push({ [library.id]: libraryStats });
// Combine all stats
for (const [key, value] of Object.entries(libraryStats)) {