Closed
Bug 848494
Opened 12 years ago
Closed 12 years ago
Create an API endpoint for submitting a rating
Categories
(Marketplace Graveyard :: API, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
2013-03-28
People
(Reporter: cvan, Assigned: chuck)
References
Details
(Whiteboard: [fireplace] p=2)
Only authenticated users can POST to this.
For free apps, anyone can post a review. For paid apps, only a user who has purchased the app can post a review.
Fields to accept:
* `app` (required - we can infer from the URL)
* `user` (required)
* `rating` (required)
* `body` (required)
Reporter | ||
Updated•12 years ago
|
Whiteboard: [fireplace]
Updated•12 years ago
|
Priority: -- → P2
Whiteboard: [fireplace] → [fireplace] p=2
Comment 1•12 years ago
|
||
Note that the code for this should be significantly less complicated than the code in mkt/ratings/views.py because there's no need to handle logic for replies or for existing reviews (i.e.: we should have separate endpoints, or at least verbs for adding and editing).
If you look at the code:
https://github.com/mozilla/zamboni/blob/master/mkt/ratings/views.py#L131
- Everything below line 228 is unnecessary
- Everything between lines 178-212 isn't necessary
- The `flag` field of the review form isn't a thing anymore.
We can safely assume:
- If there is an existing review, the client should expect an HTTP error (409 Conflict?)
- If the validation of the data fails, the client should expect an HTTP error (400 Bad Request)
- Flags are not submitted via this endpoint, so we should just not even introduce the bits of code.
Updated•12 years ago
|
Priority: P2 → P1
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → charmston
Assignee | ||
Comment 2•12 years ago
|
||
Status update: I have a working patch for this, but want to hash out authentication + authorization details with the API team before committing. Should land early next week.
Assignee | ||
Updated•12 years ago
|
Target Milestone: --- → 2013-03-28
Assignee | ||
Comment 3•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•