forked from ddrilling/asb_cloud_front
Добавлена проверка уникальностил логина
This commit is contained in:
parent
c729ffa0f0
commit
2637720762
@ -14,7 +14,17 @@ export default function UserController() {
|
||||
const userColumns = [
|
||||
makeColumn('Логин', 'login', {
|
||||
editable: true,
|
||||
formItemRules: [{ required: true }, ...createLoginRules],
|
||||
formItemRules: [
|
||||
{ required: true },
|
||||
...createLoginRules,
|
||||
() => ({
|
||||
validator(_, value) {
|
||||
if (!value || users.findIndex((user) => user.login === value) < 0)
|
||||
return Promise.resolve()
|
||||
return Promise.reject(new Error('Логин уже занят!'))
|
||||
}
|
||||
})
|
||||
],
|
||||
sorter: makeStringSorter('login'),
|
||||
}),
|
||||
makeColumn('Фамилия', 'surname', {
|
||||
|
Loading…
Reference in New Issue
Block a user