add onlySharedAccess option to i/apps endpoint
This commit is contained in:
parent
cc3076d6d2
commit
82cac0bbb7
2 changed files with 6 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ export const paramDef = {
|
|||
type: 'object',
|
||||
properties: {
|
||||
sort: { type: 'string', enum: ['+createdAt', '-createdAt', '+lastUsedAt', '-lastUsedAt'] },
|
||||
onlySharedAccess: { type: 'boolean' },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
|
@ -103,6 +104,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
default: query.orderBy('token.id', 'ASC'); break;
|
||||
}
|
||||
|
||||
if (ps.onlySharedAccess) {
|
||||
query.andWhere('token.granteeIds != \'{}\'');
|
||||
}
|
||||
|
||||
const tokens = await query.getMany();
|
||||
|
||||
const users = await this.cacheService.getUsers(tokens.flatMap(token => token.granteeIds));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue