tld length fix

This commit is contained in:
Ben Allfree
2024-01-24 01:44:10 +00:00
parent 8e94924347
commit 755feccdec
2 changed files with 45 additions and 1 deletions

View File

@@ -28,7 +28,7 @@
let successMessage = ''
const regex =
/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/
/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,24}$/
$: {
isButtonDisabled = !!formCname.trim() && !regex.test(formCname)

View File

@@ -0,0 +1,44 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "5oz9huwg",
"name": "cname",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,24}$"
}
}))
return dao.saveCollection(collection)
}, (db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "5oz9huwg",
"name": "cname",
"type": "text",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": "^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$"
}
}))
return dao.saveCollection(collection)
})