Adjust code style in user repo
Cleans up return statements in void functions
This commit is contained in:
parent
2759f8ce2b
commit
594777960b
@ -500,20 +500,17 @@ export class UserRepositoryService extends BaseRepository<ViewUser, User, UserTi
|
||||
}
|
||||
|
||||
private preventAlterationOnDemoUsers(users: ViewUser | ViewUser[]): void {
|
||||
if (!this.demoModeUserIds) {
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(users)) {
|
||||
if (users.map(user => user.id).intersect(this.demoModeUserIds).length > 0) {
|
||||
if (this.demoModeUserIds && users.map(user => user.id).intersect(this.demoModeUserIds).length > 0) {
|
||||
this.preventInDemo();
|
||||
}
|
||||
} else if (this.demoModeUserIds.some(userId => userId === users.id)) {
|
||||
} else if (this.demoModeUserIds?.some(userId => userId === users.id)) {
|
||||
this.preventInDemo();
|
||||
}
|
||||
}
|
||||
|
||||
private preventInDemo(): void {
|
||||
if (this.demoModeUserIds) {
|
||||
if (this.demoModeUserIds && this.demoModeUserIds.length) {
|
||||
throw new PreventedInDemo();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user