chore(webui): update inventory when login reward was claimed
All checks were successful
Build / build (pull_request) Successful in 52s
All checks were successful
Build / build (pull_request) Successful in 52s
This commit is contained in:
parent
0c9b27a29b
commit
340c0f6ead
@ -9,6 +9,7 @@ import {
|
||||
} from "@/src/services/loginRewardService";
|
||||
import { getInventory } from "@/src/services/inventoryService";
|
||||
import { config } from "@/src/services/configService";
|
||||
import { sendWsBroadcastTo } from "@/src/services/webService";
|
||||
|
||||
export const loginRewardsController: RequestHandler = async (req, res) => {
|
||||
const account = await getAccountForRequest(req);
|
||||
@ -51,6 +52,8 @@ export const loginRewardsController: RequestHandler = async (req, res) => {
|
||||
|
||||
setAccountGotLoginRewardToday(account);
|
||||
await account.save();
|
||||
|
||||
sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
|
||||
}
|
||||
res.json(response);
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
} from "@/src/services/loginRewardService";
|
||||
import { getAccountForRequest } from "@/src/services/loginService";
|
||||
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
|
||||
import { sendWsBroadcastTo } from "@/src/services/webService";
|
||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||
import { logger } from "@/src/utils/logger";
|
||||
import { RequestHandler } from "express";
|
||||
@ -39,6 +40,7 @@ export const loginRewardsSelectionController: RequestHandler = async (req, res)
|
||||
setAccountGotLoginRewardToday(account);
|
||||
await account.save();
|
||||
|
||||
sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
|
||||
res.json({
|
||||
DailyTributeInfo: {
|
||||
NewInventory: inventoryChanges,
|
||||
|
Loading…
x
Reference in New Issue
Block a user