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,16 +297,14 @@ 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) {
|
if (cases.length > 0) {
|
||||||
cases.sort((a, b) => {
|
cases.sort((a, b) => {
|
||||||
return a.created_at < b.created_at ? 1 : -1;
|
return a.created_at < b.created_at ? 1 : -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
const caseSummary = cases
|
const caseSummary = cases.slice(0, 3).map(c => {
|
||||||
.filter(c => !c.is_hidden)
|
|
||||||
.slice(0, 3)
|
|
||||||
.map(c => {
|
|
||||||
return `${CaseTypes[c.type]} (#${c.case_number})`;
|
return `${CaseTypes[c.type]} (#${c.case_number})`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue