更新 src/controllers/api/getGuildLogController.ts
This commit is contained in:
parent
e600cb17e3
commit
4ea2f59947
@ -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));
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user