update api.ts

feature-addByRecipeOption
Amagasu 4 months ago
parent 9eebcf670e
commit 1fb9ffcbf9
  1. 4
      frontend/src/services/api.ts

@ -132,11 +132,11 @@ export const toBuyApi = {
},
addByRecipe: async (recipeId: number, servings: number): Promise<any> => {
addByRecipe: async (recipeId: number, servings: number, difference: boolean): Promise<any> => {
const response = await fetch(`${API_BASE_URL}/api/tobuy/addByRecipe`, {
method: 'POST',
headers: getHeaders(),
body: JSON.stringify({ recipeId, servings }),
body: JSON.stringify({ recipeId, servings, difference }),
})
if (!response.ok) {
throw new Error(TOBUY_ERRORS.CREATE_FAILED);

Loading…
Cancel
Save