chore: remove needless query when sending clan invite #1434

Merged
Sainan merged 2 commits from clan-invite-try into main 2025-04-03 06:17:38 -07:00
Showing only changes of commit e33bbb0f95 - Show all commits

View File

@ -42,6 +42,7 @@ export const addToGuildController: RequestHandler = async (req, res) => {
status: 2 // outgoing invite
});
} catch (e) {
logger.debug(`guild invite failed due to ${String(e)}`);
res.status(400).json("User already invited to clan");
return;
}
@ -87,7 +88,7 @@ export const addToGuildController: RequestHandler = async (req, res) => {
RequestExpiry: new Date(Date.now() + 14 * 86400 * 1000) // TOVERIFY: I can't find any good information about this with regards to live, but 2 weeks seem reasonable.
});
} catch (e) {
// Assuming this is "E11000 duplicate key error" due to the guildId-accountId unique index.
logger.debug(`alliance invite failed due to ${String(e)}`);
res.status(400).send("Already requested");
}
res.end();