mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 07:38:13 +00:00
fix(users): remove phone validation due to incorrect check of foreign phone numebrs (#4005)
This commit is contained in:
parent
ca49cc9dbd
commit
127e2b332b
@ -91,7 +91,6 @@ const schema: ISchema = {
|
||||
title: '{{t("Phone")}}',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Input',
|
||||
'x-validator': 'phone',
|
||||
},
|
||||
footer: {
|
||||
'x-component': 'Action.Drawer.Footer',
|
||||
|
@ -60,7 +60,7 @@ export default defineCollection({
|
||||
},
|
||||
},
|
||||
{
|
||||
interface: 'phone',
|
||||
interface: 'input',
|
||||
type: 'string',
|
||||
name: 'phone',
|
||||
unique: true,
|
||||
@ -68,7 +68,6 @@ export default defineCollection({
|
||||
type: 'string',
|
||||
title: '{{t("Phone")}}',
|
||||
'x-component': 'Input',
|
||||
'x-validator': 'phone',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
@ -0,0 +1,32 @@
|
||||
import { Migration } from '@nocobase/server';
|
||||
|
||||
export default class extends Migration {
|
||||
on = 'afterLoad'; // 'beforeLoad' or 'afterLoad'
|
||||
appVersion = '<0.21.0-alpha.7';
|
||||
|
||||
async up() {
|
||||
const Field = this.context.db.getRepository('fields');
|
||||
const field = await Field.findOne({
|
||||
filter: {
|
||||
name: 'phone',
|
||||
collectionName: 'users',
|
||||
interface: 'phone',
|
||||
},
|
||||
});
|
||||
if (!field) {
|
||||
return;
|
||||
}
|
||||
await field.update({
|
||||
interface: 'input',
|
||||
options: {
|
||||
...field.options,
|
||||
uiSchema: {
|
||||
type: 'string',
|
||||
title: '{{t("Phone")}}',
|
||||
'x-component': 'Input',
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user