feat: view clan contributions #1340
@ -1,9 +1,11 @@
 | 
			
		||||
import { GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const getGuildContributionsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const guildId = (await Inventory.findOne({ accountOwnerId: req.query.accountId }, "GuildId"))!.GuildId;
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const guildId = (await getInventory(accountId, "GuildId")).GuildId;
 | 
			
		||||
    const guildMember = (await GuildMember.findOne({ guildId, accountId: req.query.buddyId }))!;
 | 
			
		||||
    res.json({
 | 
			
		||||
        _id: { $oid: req.query.buddyId },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user