更新 src/controllers/api/getGuildLogController.ts

This commit is contained in:
Master 2025-03-11 20:37:30 -07:00
parent e600cb17e3
commit 4ea2f59947

View File

@ -1,11 +1,15 @@
import { getGuildForGuildId, getGuildLog } from "@/src/services/guildService";
import { getInventory } from "@/src/services/inventoryService";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { RequestHandler } from "express"; import { RequestHandler } from "express";
export const getGuildLogController: RequestHandler = (_req, res) => { export const getGuildLogController: RequestHandler = async (req, res) => {
res.json({ const accountId = await getAccountIdForRequest(req);
RoomChanges: [], const inventory = await getInventory(accountId);
TechChanges: [], const guild = await getGuildForGuildId(inventory.GuildId?.toString() ?? "");
RosterActivity: [], if (!guild) {
StandingsUpdates: [], res.status(400).json({ error: "guild was undefined" });
ClassChanges: [] return;
}); }
res.json(await getGuildLog(accountId, guild));
}; };