fix(users): remove phone validation due to incorrect check of foreign phone numebrs (#4005)

This commit is contained in:
YANG QIA 2024-04-10 17:14:44 +08:00 committed by GitHub
parent ca49cc9dbd
commit 127e2b332b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 3 deletions

View File

@ -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',

View File

@ -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,
},
},

View File

@ -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,
},
},
});
}
}