1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

Feature/group items editor (#1064)

* update types

* remove toolbox routes

* remove unused ""

* add generic crud table

* update calls for type safety

* recreate food/unit editors

* fix type error

* remove shopping list link

* add transition

* add basic search box

* conditional show-select

* styling + basic download support

* generic download as json function

* add fraction support

* add export option

* add label text
This commit is contained in:
Hayden 2022-03-17 10:30:10 -08:00 committed by GitHub
parent 86b450fb8c
commit 8c0c8be659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 674 additions and 364 deletions

View file

@ -1,24 +1,14 @@
import { BaseCRUDAPI } from "../_base";
import { CreateIngredientUnit, IngredientUnit } from "~/types/api-types/recipe";
const prefix = "/api";
export interface CreateUnit {
name: string;
abbreviation: string;
fraction: boolean;
description: string;
}
export interface Unit extends CreateUnit {
id: number;
}
const routes = {
unit: `${prefix}/units`,
unitsUnit: (tag: string) => `${prefix}/units/${tag}`,
};
export class UnitAPI extends BaseCRUDAPI<Unit, CreateUnit> {
export class UnitAPI extends BaseCRUDAPI<IngredientUnit, CreateIngredientUnit> {
baseRoute: string = routes.unit;
itemRoute = routes.unitsUnit;
}