|
|
|
@ -109,10 +109,10 @@ export default class BaseUser {
|
|
|
|
|
public static async getUsersList( |
|
|
|
|
{ |
|
|
|
|
base_id, |
|
|
|
|
query, |
|
|
|
|
mode = 'full', |
|
|
|
|
}: { |
|
|
|
|
base_id: string; |
|
|
|
|
query?: string; |
|
|
|
|
mode?: 'full' | 'viewer'; |
|
|
|
|
}, |
|
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
|
): Promise<(Partial<User> & BaseUser)[]> { |
|
|
|
@ -126,17 +126,17 @@ export default class BaseUser {
|
|
|
|
|
`${MetaTable.USERS}.id`, |
|
|
|
|
`${MetaTable.USERS}.email`, |
|
|
|
|
`${MetaTable.USERS}.display_name`, |
|
|
|
|
`${MetaTable.USERS}.invite_token`, |
|
|
|
|
`${MetaTable.USERS}.roles as main_roles`, |
|
|
|
|
`${MetaTable.USERS}.created_at as created_at`, |
|
|
|
|
`${MetaTable.PROJECT_USERS}.base_id`, |
|
|
|
|
`${MetaTable.PROJECT_USERS}.roles as roles`, |
|
|
|
|
...(mode === 'full' |
|
|
|
|
? [ |
|
|
|
|
`${MetaTable.USERS}.invite_token`, |
|
|
|
|
`${MetaTable.USERS}.roles as main_roles`, |
|
|
|
|
`${MetaTable.USERS}.created_at as created_at`, |
|
|
|
|
`${MetaTable.PROJECT_USERS}.base_id`, |
|
|
|
|
`${MetaTable.PROJECT_USERS}.roles as roles`, |
|
|
|
|
] |
|
|
|
|
: []), |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (query) { |
|
|
|
|
queryBuilder.where('email', 'like', `%${query.toLowerCase?.()}%`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
queryBuilder.leftJoin(MetaTable.PROJECT_USERS, function () { |
|
|
|
|
this.on( |
|
|
|
|
`${MetaTable.PROJECT_USERS}.fk_user_id`, |
|
|
|
|