Fix Profile Cosmetic Not Being Included In Some User Related Requests
This commit is contained in:
parent
d4aa8761d3
commit
57c6c010ff
@ -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<bool> { Success = false, Message = "No UserId In Auth Header" });
|
||||
|
@ -13,7 +13,12 @@ namespace qtc_api.Services.StoreService
|
||||
_ctx = ctx;
|
||||
_userService = userService;
|
||||
|
||||
StoreItem[]? storeItems = JsonSerializer.Deserialize<StoreItem[]>(File.ReadAllText("./Resources/store.json"));
|
||||
string storeJsonLocation = "./Resources/store.json";
|
||||
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
storeJsonLocation = "./Resources/store.Development.json";
|
||||
|
||||
StoreItem[]? storeItems = JsonSerializer.Deserialize<StoreItem[]>(File.ReadAllText(storeJsonLocation));
|
||||
if (storeItems != null && storeItems.Length > 0)
|
||||
{
|
||||
StoreItems = storeItems.ToList();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user