chore: use inventory projection for getGuild requests (#1212)
Reviewed-on: OpenWF/SpaceNinjaServer#1212
This commit is contained in:
		
							parent
							
								
									05356af9bd
								
							
						
					
					
						commit
						1d23f2736f
					
				@ -7,7 +7,7 @@ import { createUniqueClanName, getGuildClient } from "@/src/services/guildServic
 | 
			
		||||
 | 
			
		||||
const getGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const inventory = await getInventory(accountId, "GuildId");
 | 
			
		||||
    if (inventory.GuildId) {
 | 
			
		||||
        const guild = await Guild.findOne({ _id: inventory.GuildId });
 | 
			
		||||
        if (guild) {
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@ import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getGuildLogController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const inventory = await getInventory(accountId, "GuildId");
 | 
			
		||||
    if (inventory.GuildId) {
 | 
			
		||||
        const guild = await Guild.findOne({ _id: inventory.GuildId });
 | 
			
		||||
        if (guild) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user