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

Feature/Delete an existing experience #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FortunateOmonuwa
Copy link
Member

  • Implemented a new DELETE endpoint for deleting existing experiences that returns a JSON response:
    • A 200 status code with a success message when an experience is successfully deleted.
    • 404 Not Found status code If the provided ID doesn't match any resource.
    • 500 Internal Server Error: If an exception occurs.

@Pradyuman7

@FortunateOmonuwa FortunateOmonuwa changed the title add implementation for deleting existing experience feature/delete an existing experience Feb 6, 2025
@FortunateOmonuwa FortunateOmonuwa changed the title feature/delete an existing experience Delete an existing experience Feb 6, 2025
@FortunateOmonuwa FortunateOmonuwa changed the title Delete an existing experience Feature/Delete an existing experience Feb 6, 2025
app.py Outdated
return jsonify({"message": "Resource doesn't exist"}), 404
else:
deleted_exp = data['experience'].pop(exp_id)
# return jsonify({"message": "Experience Successfully Deleted", "deleted_experience": deleted_exp}), 200
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this comment if it's not needed

app.py Outdated
# return jsonify({"message": "Experience Successfully Deleted", "deleted_experience": deleted_exp}), 200
return jsonify({"message": "Experience Successfully Deleted"}), 200
except Exception as e:
print(f"Error :{e} ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let' not include prints in production code

app.py Outdated
return jsonify({"error": "An error occured"}), 500


@app.route('/resume/education', methods=['GET', 'POST'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please are you referring to: "@app.route('/resume/education', methods=['GET', 'POST'])"

or this: "return jsonify({"error": "An error occured"}), 500"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@app.route('/resume/education', methods=['GET', 'POST'])" mainly. Is this required here?

@@ -34,6 +34,34 @@ def test_experience():
assert response.json[item_id] == example_experience



Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this all commented out? You can remove this test since the post endpoint is not there

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

Successfully merging this pull request may close these issues.

2 participants