1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

refactor(frontend): 🚧 Migrate Dashboard to Nuxt

Add API and Functinality for Admin Dashboard. Stills needs to clean-up. See // TODO's
This commit is contained in:
hay-kot 2021-08-07 15:12:25 -08:00
parent 41a6916771
commit 9386cc320b
32 changed files with 671 additions and 113 deletions

View file

@ -44,15 +44,17 @@ export const crudMixins = <T>(
return { getAll, getOne, updateOne, patchOne, deleteOne, createOne };
};
export abstract class BaseAPIClass<T, U> implements CrudAPIInterface {
export abstract class BaseAPI {
requests: ApiRequestInstance;
abstract baseRoute: string;
abstract itemRoute(itemId: string | number): string;
constructor(requests: ApiRequestInstance) {
this.requests = requests;
}
}
export abstract class BaseCRUDAPI<T, U> extends BaseAPI implements CrudAPIInterface {
abstract baseRoute: string;
abstract itemRoute(itemId: string | number): string;
async getAll(start = 0, limit = 9999) {
return await this.requests.get<T[]>(this.baseRoute, {