From 57c6c010ff4568d4465eec97e37294f664cfef11 Mon Sep 17 00:00:00 2001 From: Moonbase Date: Sun, 3 Aug 2025 14:20:18 -0700 Subject: [PATCH] Fix Profile Cosmetic Not Being Included In Some User Related Requests --- qtc-net-server/Controllers/StoreController.cs | 5 ++--- qtc-net-server/Services/StoreService/StoreService.cs | 7 ++++++- qtc-net-server/Services/UserService/UserService.cs | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qtc-net-server/Controllers/StoreController.cs b/qtc-net-server/Controllers/StoreController.cs index 10c36d7..597a610 100644 --- a/qtc-net-server/Controllers/StoreController.cs +++ b/qtc-net-server/Controllers/StoreController.cs @@ -11,11 +11,9 @@ namespace qtc_api.Controllers public class StoreController : ControllerBase { private readonly StoreService _storeService; - private readonly IUserService _userService; - public StoreController(StoreService storeService, IUserService userService) + public StoreController(StoreService storeService) { _storeService = storeService; - _userService = userService; } [HttpGet] @@ -89,6 +87,7 @@ namespace qtc_api.Controllers if (userId != null) { var result = await _storeService.BuyStoreItem(userId, id); + return Ok(result); } else return Ok(new ServiceResponse { Success = false, Message = "No UserId In Auth Header" }); diff --git a/qtc-net-server/Services/StoreService/StoreService.cs b/qtc-net-server/Services/StoreService/StoreService.cs index 368560a..d849482 100644 --- a/qtc-net-server/Services/StoreService/StoreService.cs +++ b/qtc-net-server/Services/StoreService/StoreService.cs @@ -13,7 +13,12 @@ namespace qtc_api.Services.StoreService _ctx = ctx; _userService = userService; - StoreItem[]? storeItems = JsonSerializer.Deserialize(File.ReadAllText("./Resources/store.json")); + string storeJsonLocation = "./Resources/store.json"; + + if (System.Diagnostics.Debugger.IsAttached) + storeJsonLocation = "./Resources/store.Development.json"; + + StoreItem[]? storeItems = JsonSerializer.Deserialize(File.ReadAllText(storeJsonLocation)); if (storeItems != null && storeItems.Length > 0) { StoreItems = storeItems.ToList(); diff --git a/qtc-net-server/Services/UserService/UserService.cs b/qtc-net-server/Services/UserService/UserService.cs index 51f6892..47c7ddf 100644 --- a/qtc-net-server/Services/UserService/UserService.cs +++ b/qtc-net-server/Services/UserService/UserService.cs @@ -111,6 +111,7 @@ namespace qtc_api.Services.UserService x.CurrencyAmount = user.CurrencyAmount; x.Status = user.Status; x.CreatedAt = user.CreatedAt; + x.ProfileCosmeticId = user.ActiveProfileCosmetic; userInfoList.Add(x); } @@ -141,6 +142,7 @@ namespace qtc_api.Services.UserService x.CreatedAt = user.CreatedAt; x.CurrencyAmount = user.CurrencyAmount; x.CreatedAt = user.CreatedAt; + x.ProfileCosmeticId = user.ActiveProfileCosmetic; onlineUsers.Add(x); }