Don't count hidden cases in !info
This commit is contained in:
parent
f6f1c29fc1
commit
9a5a9a64da
1 changed files with 5 additions and 7 deletions
|
@ -297,18 +297,16 @@ export class UtilityPlugin extends ZeppelinPlugin {
|
|||
});
|
||||
}
|
||||
|
||||
const cases = await this.cases.getByUserId(args.userId);
|
||||
const cases = (await this.cases.getByUserId(args.userId)).filter(c => !c.is_hidden);
|
||||
|
||||
if (cases.length > 0) {
|
||||
cases.sort((a, b) => {
|
||||
return a.created_at < b.created_at ? 1 : -1;
|
||||
});
|
||||
|
||||
const caseSummary = cases
|
||||
.filter(c => !c.is_hidden)
|
||||
.slice(0, 3)
|
||||
.map(c => {
|
||||
return `${CaseTypes[c.type]} (#${c.case_number})`;
|
||||
});
|
||||
const caseSummary = cases.slice(0, 3).map(c => {
|
||||
return `${CaseTypes[c.type]} (#${c.case_number})`;
|
||||
});
|
||||
|
||||
const summaryText = cases.length > 3 ? "Last 3 cases" : "Summary";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue