fix: reversed unique check
This commit is contained in:
parent
fb44cf9fa3
commit
456131602f
@ -29,7 +29,7 @@ export class LowUserRepo implements IUserRepo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async create(user: New<User>) {
|
async create(user: New<User>) {
|
||||||
if (!this.db.data.users.find((u) => u.name == user.name)) {
|
if (this.db.data.users.some((u) => u.name == user.name)) {
|
||||||
return UserErrors.DUPLICATE_NAME;
|
return UserErrors.DUPLICATE_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user