mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
* Fix or comment several ts-ignores * Fix typing related to BaseOverflowButton * Remove unused functionality of useCookbooks, fix usage bug * Fix more typing, add some comments * Only allow ts-ignore if it has a comment
20 lines
576 B
TypeScript
20 lines
576 B
TypeScript
import { BaseCRUDAPI } from "../_base";
|
|
import { RecipeTool, RecipeToolCreate, RecipeToolResponse } from "~/types/api-types/recipe";
|
|
|
|
const prefix = "/api";
|
|
|
|
const routes = {
|
|
tools: `${prefix}/tools`,
|
|
toolsId: (id: string) => `${prefix}/tools/${id}`,
|
|
toolsSlug: (id: string) => `${prefix}/tools/slug/${id}`,
|
|
};
|
|
|
|
export class ToolsApi extends BaseCRUDAPI<RecipeTool, RecipeToolCreate> {
|
|
baseRoute: string = routes.tools;
|
|
itemRoute = routes.toolsId;
|
|
|
|
async byslug(slug: string) {
|
|
return await this.requests.get<RecipeToolResponse>(routes.toolsSlug(slug));
|
|
}
|
|
}
|