mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-23 15:19:41 +02:00
add merge funcions for units (#1146)
This commit is contained in:
parent
b93dae109e
commit
db095656e1
8 changed files with 172 additions and 25 deletions
|
@ -6,9 +6,15 @@ const prefix = "/api";
|
|||
const routes = {
|
||||
unit: `${prefix}/units`,
|
||||
unitsUnit: (tag: string) => `${prefix}/units/${tag}`,
|
||||
merge: `${prefix}/units/merge`,
|
||||
};
|
||||
|
||||
export class UnitAPI extends BaseCRUDAPI<IngredientUnit, CreateIngredientUnit> {
|
||||
baseRoute: string = routes.unit;
|
||||
itemRoute = routes.unitsUnit;
|
||||
|
||||
merge(fromId: string, toId: string) {
|
||||
// @ts-ignore TODO: fix this
|
||||
return this.requests.put<IngredientUnit>(routes.merge, { fromUnit: fromId, toUnit: toId });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue