feat: clan members #1143

Merged
OrdisPrime merged 12 commits from clan-members into main 2025-03-10 16:40:41 -07:00
Showing only changes of commit fd329f78f1 - Show all commits

View File

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