feat: enhance superadmin dashboard overview
This commit is contained in:
@@ -130,5 +130,21 @@ export const ContentService = {
|
||||
reason
|
||||
}
|
||||
});
|
||||
},
|
||||
async getContentStatistics({ tenant_id, start_at, end_at, granularity } = {}) {
|
||||
const iso = (d) => {
|
||||
if (!d) return undefined;
|
||||
const date = d instanceof Date ? d : new Date(d);
|
||||
if (Number.isNaN(date.getTime())) return undefined;
|
||||
return date.toISOString();
|
||||
};
|
||||
|
||||
const query = {
|
||||
tenant_id,
|
||||
start_at: iso(start_at),
|
||||
end_at: iso(end_at),
|
||||
granularity
|
||||
};
|
||||
return requestJson('/super/v1/contents/statistics', { query });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user