mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-17 23:25:02 +00:00
Add a warning when the user has >= specified amount of warns
This commit is contained in:
parent
2f89d3ae25
commit
930dabf5cd
2 changed files with 25 additions and 0 deletions
|
@ -266,4 +266,19 @@ export class CasesPlugin extends ZeppelinPlugin<ICasesPluginConfig> {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async getCaseTypeAmountForUserId(userID: string, type: CaseTypes) {
|
||||
const cases = (await this.cases.getByUserId(userID)).filter(c => !c.is_hidden);
|
||||
let typeAmount = 0;
|
||||
|
||||
if (cases.length > 0) {
|
||||
cases.forEach(singleCase => {
|
||||
if (singleCase.type == type.valueOf()) {
|
||||
typeAmount++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return typeAmount;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue