1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00

refactor(frontend): 🚧 Add group/user CRUD support for admins

This commit is contained in:
hay-kot 2021-08-06 16:28:12 -08:00
parent 917177da5b
commit 695d7e96ae
46 changed files with 2015 additions and 102 deletions

View file

@ -0,0 +1,26 @@
import { requests } from "../requests";
import { BaseAPIClass } from "./_base";
import { GroupInDB } from "~/types/api-types/user";
const prefix = "/api";
const routes = {
groups: `${prefix}/groups`,
groupsSelf: `${prefix}/groups/self`,
groupsId: (id: string | number) => `${prefix}/groups/${id}`,
};
export interface CreateGroup {
name: string;
}
export class GroupAPI extends BaseAPIClass<GroupInDB, CreateGroup> {
baseRoute = routes.groups;
itemRoute = routes.groupsId;
/** Returns the Group Data for the Current User
*/
async getCurrentUserGroup() {
return await requests.get(routes.groupsSelf);
}
}