Skip to content

Conversation

RandomProgramm3r
Copy link
Owner

Add two new idempotent endpoints to manage likes on promo codes:

  • POST /user/promo/{id}/like – add a like to the specified promo code
  • DELETE /user/promo/{id}/like – remove a like from the specified promo code

Both operations return HTTP 200 and do not modify the like count if:

  1. The user has already liked the promo code (on POST), or
  2. The user has no existing like to remove (on DELETE).

Validate that the promo code exists before processing the request; return HTTP 404 if not found.

Add two new idempotent endpoints to manage likes on promo codes:

- **POST** `/user/promo/{id}/like` – add a like to the specified promo code
- **DELETE** `/user/promo/{id}/like` – remove a like from the specified promo code

Both operations return HTTP 200 and do not modify the like count if:
1. The user has already liked the promo code (on POST), or
2. The user has no existing like to remove (on DELETE).

Validate that the promo code exists before processing the request; return HTTP 404 if not found.
@RandomProgramm3r RandomProgramm3r merged commit 5cfcec5 into main May 13, 2025
2 checks passed
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.

1 participant