mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-28 16:54:19 -04: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:
@@ -1,7 +1,7 @@
|
||||
import { AxiosResponse } from "axios";
|
||||
import { useContext } from "@nuxtjs/composition-api";
|
||||
import { NuxtAxiosInstance } from "@nuxtjs/axios";
|
||||
import { Api } from "~/api";
|
||||
import { AdminAPI, Api } from "~/api";
|
||||
import { ApiRequestInstance } from "~/types/api";
|
||||
|
||||
interface RequestResponse<T> {
|
||||
@@ -53,6 +53,11 @@ function getRequests(axoisInstance: NuxtAxiosInstance): ApiRequestInstance {
|
||||
return requests;
|
||||
}
|
||||
|
||||
export const useAdminApi = function (): AdminAPI {
|
||||
const { $axios } = useContext();
|
||||
const requests = getRequests($axios);
|
||||
return new AdminAPI(requests);
|
||||
};
|
||||
|
||||
export const useApiSingleton = function (): Api {
|
||||
const { $axios } = useContext();
|
||||
|
||||
Reference in New Issue
Block a user