mirror of
https://github.com/s-frick/effigenix.git
synced 2026-03-28 12:09:35 +01:00
feat(production): TUI-Screens für Zutaten verwalten + Rezept aktivieren
This commit is contained in:
parent
63f51bc1a9
commit
5224001dd7
6 changed files with 241 additions and 20 deletions
|
|
@ -1,9 +1,4 @@
|
|||
/**
|
||||
* Recipes resource – Production BC.
|
||||
* Endpoints: POST /api/recipes,
|
||||
* POST /api/recipes/{id}/ingredients,
|
||||
* DELETE /api/recipes/{id}/ingredients/{ingredientId}
|
||||
*/
|
||||
/** Recipes resource – Production BC. */
|
||||
|
||||
import type { AxiosInstance } from 'axios';
|
||||
import type {
|
||||
|
|
@ -59,10 +54,8 @@ export function createRecipesResource(client: AxiosInstance) {
|
|||
return res.data;
|
||||
},
|
||||
|
||||
async removeIngredient(recipeId: string, ingredientId: string): Promise<RecipeDTO> {
|
||||
async removeIngredient(recipeId: string, ingredientId: string): Promise<void> {
|
||||
await client.delete(`${BASE}/${recipeId}/ingredients/${ingredientId}`);
|
||||
const res = await client.get<RecipeDTO>(`${BASE}/${recipeId}`);
|
||||
return res.data;
|
||||
},
|
||||
|
||||
async addProductionStep(id: string, request: AddProductionStepRequest): Promise<RecipeDTO> {
|
||||
|
|
@ -73,6 +66,11 @@ export function createRecipesResource(client: AxiosInstance) {
|
|||
async removeProductionStep(id: string, stepNumber: number): Promise<void> {
|
||||
await client.delete(`${BASE}/${id}/steps/${stepNumber}`);
|
||||
},
|
||||
|
||||
async activateRecipe(id: string): Promise<RecipeDTO> {
|
||||
const res = await client.post<RecipeDTO>(`${BASE}/${id}/activate`);
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue