feat: Clan creation & persistence #146

Merged
Sainan merged 5 commits from clans into main 2024-05-04 06:42:25 -07:00
Showing only changes of commit 2c0f69abbb - Show all commits

View File

@ -18,10 +18,19 @@ const createGuildController: RequestHandler = async (req, res) => {
} satisfies IGuild);
await guild.save();
// Update account's guild
// Update inventory
let inventory = await Inventory.findOne({ accountOwnerId: req.query.accountId });
if (inventory) {
// Set GuildId
inventory.GuildId = guild._id;
// Give clan key
inventory.LevelKeys ??= [];
inventory.LevelKeys.push({
ItemType: "/Lotus/Types/Keys/DojoKey",
ItemCount: 1
});
await inventory.save();
}