mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
feat(frontend): ✨ Create CRUD User Interface for Units and Foods
This commit is contained in:
parent
122d35ec09
commit
a1aad078da
13 changed files with 517 additions and 42 deletions
23
frontend/api/class-interfaces/recipe-units.ts
Normal file
23
frontend/api/class-interfaces/recipe-units.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { BaseCRUDAPI } from "./_base";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
export interface CreateUnit {
|
||||
name: string;
|
||||
abbreviation: string;
|
||||
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> {
|
||||
baseRoute: string = routes.unit;
|
||||
itemRoute = routes.unitsUnit;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue