Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inquiry #9

Open
brightmaraba opened this issue Feb 28, 2020 · 0 comments
Open

Inquiry #9

brightmaraba opened this issue Feb 28, 2020 · 0 comments

Comments

@brightmaraba
Copy link

brightmaraba commented Feb 28, 2020

code
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant