chore: use inventory projection for getGuild requests (#1212)
All checks were successful
Build / build (18) (push) Successful in 42s
Build / build (20) (push) Successful in 1m6s
Build / build (22) (push) Successful in 1m4s
Build Docker image / docker (push) Successful in 37s

Reviewed-on: #1212
This commit is contained in:
Sainan 2025-03-16 08:16:49 -07:00
parent 05356af9bd
commit 1d23f2736f
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import { createUniqueClanName, getGuildClient } from "@/src/services/guildServic
const getGuildController: RequestHandler = async (req, res) => { const getGuildController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId, "GuildId");
if (inventory.GuildId) { if (inventory.GuildId) {
const guild = await Guild.findOne({ _id: inventory.GuildId }); const guild = await Guild.findOne({ _id: inventory.GuildId });
if (guild) { if (guild) {

View File

@ -7,7 +7,7 @@ import { RequestHandler } from "express";
export const getGuildLogController: RequestHandler = async (req, res) => { export const getGuildLogController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req); const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId); const inventory = await getInventory(accountId, "GuildId");
if (inventory.GuildId) { if (inventory.GuildId) {
const guild = await Guild.findOne({ _id: inventory.GuildId }); const guild = await Guild.findOne({ _id: inventory.GuildId });
if (guild) { if (guild) {