fix(client): server utils setting related IDs to null

This commit is contained in:
Zhongheng Liu 2025-12-29 14:00:06 +01:00
commit 71bb6d03ed

View file

@ -146,7 +146,9 @@ public class ServerUtils {
Recipe recipe = objectMapper.readValue(response.body(), Recipe.class);
recipe.setId(null); // otherwise the id is the same as the original, and that's wrong
// now that each recipeIngredient has its own ID in the database,
// we set that to null too to force a new persist value on the server
recipe.getIngredients().forEach(ingredient -> ingredient.setId(null));
return addRecipe(recipe);
}