mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 23:59:45 +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
22
frontend/api/class-interfaces/recipe-foods.ts
Normal file
22
frontend/api/class-interfaces/recipe-foods.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { BaseCRUDAPI } from "./_base";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
export interface CreateFood {
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface Food extends CreateFood {
|
||||
id: number;
|
||||
}
|
||||
|
||||
const routes = {
|
||||
food: `${prefix}/foods`,
|
||||
foodsFood: (tag: string) => `${prefix}/foods/${tag}`,
|
||||
};
|
||||
|
||||
export class FoodAPI extends BaseCRUDAPI<Food, CreateFood> {
|
||||
baseRoute: string = routes.food;
|
||||
itemRoute = routes.foodsFood;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue