Skip to content

Commit

Permalink
Entitlements Get API filter by status
Browse files Browse the repository at this point in the history
  • Loading branch information
frifugio authored Jul 12, 2023
1 parent 5436d88 commit bacbe3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/mock_api/endpoints/drops/entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func getEntitlements(w http.ResponseWriter, r *http.Request) {
id := r.URL.Query().Get("id")
userID := r.URL.Query().Get("user_id")
gameID := r.URL.Query().Get("game_id")
status := r.URL.Query().Get("fulfillment_status")

if userCtx.UserID != "" && userID != "" {
mock_errors.WriteBadRequest(w, "user_id is invalid when using user access token")
Expand All @@ -78,7 +79,7 @@ func getEntitlements(w http.ResponseWriter, r *http.Request) {
if userCtx.UserID != "" {
userID = userCtx.UserID
}
e := database.DropsEntitlement{UserID: userID, GameID: gameID, ID: id}
e := database.DropsEntitlement{UserID: userID, GameID: gameID, ID: id, Status: status}
dbr, err := db.NewQuery(r, 1000).GetDropsEntitlements(e)
if err != nil {
mock_errors.WriteServerError(w, "error fetching entitlements")
Expand Down

0 comments on commit bacbe3f

Please sign in to comment.