mealie/frontend/api/class-interfaces/tools.ts
Hayden 7afdd5b577
Feature/restore-recipe-functionality (#810)
* feat(frontend):  add back support for assets

* feat(backend):  add back support for assets

* feat(frontend):  add support for recipe tools

* feat(backend):  add support for recipe tools

* feat(frontend):  add onHand support for recipe toosl

* feat(backend):  add onHand support for backend

* refactor(frontend): ♻️ move items to recipe folder and break apart types

* feat(frontend):  add support for recipe comments

* feat(backend):  Add support for recipe comments

* fix(backend): 💥 disable comments import

* fix(frontend): 🐛 fix rendering issue with titles when moving steps

* add tools to changelog

* fix type errors

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-11-22 20:10:48 -09:00

22 lines
424 B
TypeScript

import { BaseCRUDAPI } from "../_base";
const prefix = "/api";
export interface CreateTool {
name: string;
onHand: boolean;
}
export interface Tool extends CreateTool {
id: number;
}
const routes = {
tools: `${prefix}/tools`,
toolsId: (id: string) => `${prefix}/tools/${id}`,
};
export class ToolsApi extends BaseCRUDAPI<Tool, CreateTool> {
baseRoute: string = routes.tools;
itemRoute = routes.toolsId;
}