mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 06:39:41 +02:00
feat: add group statistics on profile page
* resolve file not found error and add constants * add group stats and storage functionality * generate new types * add statistics and storage cap graphs * fix: add loadFood query param #1103 * refactor to flex view
This commit is contained in:
parent
b57e42a3b3
commit
1e90dc2022
13 changed files with 326 additions and 32 deletions
|
@ -1,5 +1,6 @@
|
|||
import { BaseCRUDAPI } from "../_base";
|
||||
import { GroupInDB, UserOut } from "~/types/api-types/user";
|
||||
import { GroupStatistics, GroupStorage } from "~/types/api-types/group";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
|
@ -11,6 +12,8 @@ const routes = {
|
|||
permissions: `${prefix}/groups/permissions`,
|
||||
|
||||
preferences: `${prefix}/groups/preferences`,
|
||||
statistics: `${prefix}/groups/statistics`,
|
||||
storage: `${prefix}/groups/storage`,
|
||||
|
||||
invitation: `${prefix}/groups/invitations`,
|
||||
|
||||
|
@ -103,4 +106,12 @@ export class GroupAPI extends BaseCRUDAPI<GroupInDB, CreateGroup> {
|
|||
// TODO: This should probably be a patch request, which isn't offered by the API currently
|
||||
return await this.requests.put<Permissions, SetPermissions>(routes.permissions, payload);
|
||||
}
|
||||
|
||||
async statistics() {
|
||||
return await this.requests.get<GroupStatistics>(routes.statistics);
|
||||
}
|
||||
|
||||
async storage() {
|
||||
return await this.requests.get<GroupStorage>(routes.storage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue