Implement the backend APIs required to support the upvote-label feature. This includes creating endpoints to retrieve snippet labels, upvote labels, undo label upvotes, and create/apply/upvote new labels. These APIs will facilitate user interactions with labels on detected snippets, including fetching label details, upvoting, and applying new labels.
Requirements:
API Endpoints:
get_snippet_labels(snippet_id)
Functionality: Retrieve all labels applied to a given snippet along with their metadata.
Implement the backend APIs required to support the
upvote-label
feature. This includes creating endpoints to retrieve snippet labels, upvote labels, undo label upvotes, and create/apply/upvote new labels. These APIs will facilitate user interactions with labels on detected snippets, including fetching label details, upvoting, and applying new labels.Requirements:
API Endpoints:
get_snippet_labels(snippet_id)
upvote_label(snippet_id, label_text)
get_snippet_labels()
response.undo_upvote_label(snippet_id, label_text)
get_snippet_labels()
response.create_apply_and_upvote_label(snippet_id, label_text)
get_snippet_labels()
response.Code Examples:
Acceptance Criteria: