mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-22 22:59:41 +02:00
refactor(♻️): update 'about' page to new composition API (#667)
* test-commit * Remove PR Name Checker * refactor(backend): ♻️ split unrelated routes into clearer router paths Add an /app and /admin router base paths to split previously grouped public/admin data into different paths. Part of a longer migration to move 'admin' operations under the admin path. * refactor(backend): ♻️ rename imports * refactor(frontend): ♻️ refactor frontend API and Pages to refelect new API design Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
c7f8c96287
commit
abc0d0d59f
23 changed files with 317 additions and 275 deletions
|
@ -1,7 +1,6 @@
|
|||
import { RecipeAPI } from "./class-interfaces/recipes";
|
||||
import { UserApi } from "./class-interfaces/users";
|
||||
import { GroupAPI } from "./class-interfaces/groups";
|
||||
import { DebugAPI } from "./class-interfaces/debug";
|
||||
import { EventsAPI } from "./class-interfaces/events";
|
||||
import { BackupAPI } from "./class-interfaces/backups";
|
||||
import { UploadFile } from "./class-interfaces/upload";
|
||||
|
@ -13,14 +12,30 @@ import { FoodAPI } from "./class-interfaces/recipe-foods";
|
|||
import { UnitAPI } from "./class-interfaces/recipe-units";
|
||||
import { CookbookAPI } from "./class-interfaces/cookbooks";
|
||||
import { WebhooksAPI } from "./class-interfaces/group-webhooks";
|
||||
import { AdminAboutAPI } from "./class-interfaces/admin-about";
|
||||
import { ApiRequestInstance } from "~/types/api";
|
||||
|
||||
class AdminAPI {
|
||||
private static instance: AdminAPI;
|
||||
public about: AdminAboutAPI;
|
||||
|
||||
constructor(requests: ApiRequestInstance) {
|
||||
if (AdminAPI.instance instanceof AdminAPI) {
|
||||
return AdminAPI.instance;
|
||||
}
|
||||
|
||||
this.about = new AdminAboutAPI(requests);
|
||||
|
||||
Object.freeze(this);
|
||||
AdminAPI.instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
class Api {
|
||||
private static instance: Api;
|
||||
public recipes: RecipeAPI;
|
||||
public users: UserApi;
|
||||
public groups: GroupAPI;
|
||||
public debug: DebugAPI;
|
||||
public events: EventsAPI;
|
||||
public backups: BackupAPI;
|
||||
public categories: CategoriesAPI;
|
||||
|
@ -54,7 +69,6 @@ class Api {
|
|||
this.groupWebhooks = new WebhooksAPI(requests);
|
||||
|
||||
// Admin
|
||||
this.debug = new DebugAPI(requests);
|
||||
this.events = new EventsAPI(requests);
|
||||
this.backups = new BackupAPI(requests);
|
||||
this.notifications = new NotificationsAPI(requests);
|
||||
|
@ -68,4 +82,4 @@ class Api {
|
|||
}
|
||||
}
|
||||
|
||||
export { Api };
|
||||
export { Api, AdminAPI };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue