更新 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";
export const getGuildLogController: RequestHandler = (_req, res) => {
res.json({
RoomChanges: [],
TechChanges: [],
RosterActivity: [],
StandingsUpdates: [],
ClassChanges: []
});
export const getGuildLogController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId);
const guild = await getGuildForGuildId(inventory.GuildId?.toString() ?? "");
if (!guild) {
res.status(400).json({ error: "guild was undefined" });
return;
}
res.json(await getGuildLog(accountId, guild));
};