You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Chapter 2 Activity 4: Implementing The Delete Recipe Function your solution calls for creating a new Routing {Which should be taken care of by the Resources Library}. I do not understand why you couldn't implement a new method delete under the class RecipeResource? As below? It works perfectly as tested in Postman. Thanks and best regards.
def delete(self, recipe_id):
recipe = next((recipe for recipe in recipe_list if recipe.id == recipe_id), None)
if recipe is None:
return {'message': 'recipe not found'}, HTTPStatus.NOT_FOUND
recipe_list.remove(recipe)
return {}, HTTPStatus.NO_CONTENT
The text was updated successfully, but these errors were encountered:
On Chapter 2 Activity 4: Implementing The Delete Recipe Function your solution calls for creating a new Routing {Which should be taken care of by the Resources Library}. I do not understand why you couldn't implement a new method delete under the class RecipeResource? As below? It works perfectly as tested in Postman. Thanks and best regards.
def delete(self, recipe_id):
The text was updated successfully, but these errors were encountered: