Create an API endpoint for submitting a rating

RESOLVED FIXED in 2013-03-28

Status

Marketplace
API
P1
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: cvan, Assigned: chuck)

Tracking

2013-03-28
Points:
---
Dependency tree / graph

Details

(Whiteboard: [fireplace] p=2)

(Reporter)

Description

5 years ago
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

5 years ago
Whiteboard: [fireplace]

Updated

5 years ago
Priority: -- → P2
Whiteboard: [fireplace] → [fireplace] p=2

Comment 1

5 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

5 years ago
Priority: P2 → P1
(Assignee)

Updated

5 years ago
Assignee: nobody → charmston
(Assignee)

Comment 2

5 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

5 years ago
Target Milestone: --- → 2013-03-28
(Assignee)

Updated

5 years ago
Blocks: 855315
(Assignee)

Comment 3

5 years ago
Landed: https://github.com/mozilla/zamboni/commit/aa96f1740bab9bd8dd6955b1517eb9c2ad1728f4
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Blocks: 859511
You need to log in before you can comment on or make changes to this bug.