Fix logic error in case creation for manual kicks
This commit is contained in:
parent
14bebfe405
commit
a60cb92b74
1 changed files with 3 additions and 4 deletions
|
@ -28,11 +28,10 @@ export const CreateKickCaseOnManualKickEvt = modActionsEvt(
|
|||
);
|
||||
|
||||
if (kickAuditLogEntry) {
|
||||
const existingCaseForThisEntry = await pluginData.state.cases.findByAuditLogId(kickAuditLogEntry.id);
|
||||
let createdCase;
|
||||
if (existingCaseForThisEntry) {
|
||||
let createdCase = await pluginData.state.cases.findByAuditLogId(kickAuditLogEntry.id);
|
||||
if (createdCase) {
|
||||
logger.warn(
|
||||
`Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${existingCaseForThisEntry.id}`,
|
||||
`Tried to create duplicate case for audit log entry ${kickAuditLogEntry.id}, existing case id ${createdCase.id}`,
|
||||
);
|
||||
} else {
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
|
|
Loading…
Add table
Reference in a new issue