Skip to content

Commit

Permalink
Merge pull request #251 from frifugio/main
Browse files Browse the repository at this point in the history
GET Drops Entitlements "mock-API" - Enabled filter by status
  • Loading branch information
Xemdo authored Jul 13, 2023
2 parents 5436d88 + bacbe3f commit 5a867de
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 5a867de

Please sign in to comment.