mealie/frontend/api/class-interfaces/group-cookbooks.ts
Hayden cfaac2e060
feat: additional cookbook features (tags, tools, and public) (#1116)
* migration: add public, tags, and tools

* generate frontend types

* add help icon

* start replacement for tool-tag-category selector

* add help icon utility

* use generator types

* add support for cookbook features

* add UI elements for cookbook features

* fix tests

* fix type error
2022-04-01 09:50:31 -08:00

18 lines
557 B
TypeScript

import { BaseCRUDAPI } from "../_base";
import { CreateCookBook, RecipeCookBook, UpdateCookBook } from "~/types/api-types/cookbook";
const prefix = "/api";
const routes = {
cookbooks: `${prefix}/groups/cookbooks`,
cookbooksId: (id: number) => `${prefix}/groups/cookbooks/${id}`,
};
export class CookbookAPI extends BaseCRUDAPI<RecipeCookBook, CreateCookBook> {
baseRoute: string = routes.cookbooks;
itemRoute = routes.cookbooksId;
async updateAll(payload: UpdateCookBook[]) {
return await this.requests.put(this.baseRoute, payload);
}
}