Skip to content

Inquiry #9

Open
Open
@brightmaraba

Description

@brightmaraba

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions