From bacbe3f2038b72e7c1963a337f9966e12c2166dc Mon Sep 17 00:00:00 2001 From: Francesco Rifugio Date: Wed, 12 Jul 2023 16:27:07 +0100 Subject: [PATCH] Entitlements Get API filter by status --- internal/mock_api/endpoints/drops/entitlements.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/mock_api/endpoints/drops/entitlements.go b/internal/mock_api/endpoints/drops/entitlements.go index 7833d87d..bd36465c 100644 --- a/internal/mock_api/endpoints/drops/entitlements.go +++ b/internal/mock_api/endpoints/drops/entitlements.go @@ -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") @@ -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")