def get(self): uuid = request.args.get("uuid") if not uuid: return { 'message': "Missing uuid parameter", 'description': { 'search_key': 'uuid', 'search_value': uuid } }, 404 recipe = RecipeModel.findby_id(uuid) if recipe: return recipe_schema.dump(recipe), 200 return {'message': "Recipe not found", 'description': uuid}, 404
def delete(self): uuid = request.args.get('uuid') if not uuid: return { 'message': "Missing uuid parameter", 'description': { 'search_key': 'uuid', 'search_value': uuid } }, 404 recipe = RecipeModel.findby_id(uuid) if recipe: recipe.deletefrom_db() return {'message': 'Recipe deleted', 'description': uuid} return {'message': 'Recipe not found', 'description': uuid}, 404