chore: delete clan invite email when member is kicked before accepting
All checks were successful
Build / build (20) (push) Successful in 43s
Build / build (18) (push) Successful in 1m20s
Build / build (18) (pull_request) Successful in 47s
Build / build (20) (pull_request) Successful in 1m17s
Build / build (22) (pull_request) Successful in 1m26s
Build / build (22) (push) Successful in 1m16s
All checks were successful
Build / build (20) (push) Successful in 43s
Build / build (18) (push) Successful in 1m20s
Build / build (18) (pull_request) Successful in 47s
Build / build (20) (pull_request) Successful in 1m17s
Build / build (22) (pull_request) Successful in 1m26s
Build / build (22) (push) Successful in 1m16s
This commit is contained in:
parent
30ae95bec8
commit
bfa992bf79
@ -1,4 +1,5 @@
|
|||||||
import { GuildMember } from "@/src/models/guildModel";
|
import { GuildMember } from "@/src/models/guildModel";
|
||||||
|
import { Inbox } from "@/src/models/inboxModel";
|
||||||
import { Account } from "@/src/models/loginModel";
|
import { Account } from "@/src/models/loginModel";
|
||||||
import { getGuildForRequest, hasGuildPermission } from "@/src/services/guildService";
|
import { getGuildForRequest, hasGuildPermission } from "@/src/services/guildService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
@ -36,7 +37,8 @@ export const removeFromGuildController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
// TODO: Handle clan leader kicking themselves (guild should be deleted in this case, I think)
|
// TODO: Handle clan leader kicking themselves (guild should be deleted in this case, I think)
|
||||||
} else if (guildMember.status == 2) {
|
} else if (guildMember.status == 2) {
|
||||||
// TODO: Maybe the inbox message for the sent invite should be deleted?
|
// Delete the inbox message for the invite
|
||||||
|
await Inbox.deleteOne({ ownerId: guildMember.accountId, contextInfo: guild._id.toString() });
|
||||||
}
|
}
|
||||||
await GuildMember.deleteOne({ _id: guildMember._id });
|
await GuildMember.deleteOne({ _id: guildMember._id });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user