feat: clan members #1143
@ -3,6 +3,7 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
 | 
			
		||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
 | 
			
		||||
import { Guild, GuildMember } from "@/src/models/guildModel";
 | 
			
		||||
import { addRecipes } from "@/src/services/inventoryService";
 | 
			
		||||
 | 
			
		||||
export const createGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
@ -28,11 +29,13 @@ export const createGuildController: RequestHandler = async (req, res) => {
 | 
			
		||||
        // Set GuildId
 | 
			
		||||
        inventory.GuildId = guild._id;
 | 
			
		||||
 | 
			
		||||
        // Give clan key (TODO: This should only be a blueprint)
 | 
			
		||||
        inventory.LevelKeys.push({
 | 
			
		||||
            ItemType: "/Lotus/Types/Keys/DojoKey",
 | 
			
		||||
            ItemCount: 1
 | 
			
		||||
        });
 | 
			
		||||
        // Give clan key blueprint
 | 
			
		||||
        addRecipes(inventory, [
 | 
			
		||||
            {
 | 
			
		||||
                ItemType: "/Lotus/Types/Keys/DojoKeyBlueprint",
 | 
			
		||||
                ItemCount: 1
 | 
			
		||||
            }
 | 
			
		||||
        ]);
 | 
			
		||||
 | 
			
		||||
        await inventory.save();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user