Skip to content

Commit 536fd45

Browse files
committed
fix: schema definition POSTLivechatSaveCustomFieldsSchema
1 parent c5cee9a commit 536fd45

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

apps/meteor/app/livechat/server/api/v1/customField.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ const livechatCustomFieldsEndpoints = API.v1
111111
async function action() {
112112
const { customFieldId, customFieldData } = this.bodyParams;
113113

114-
if (!/^[0-9a-zA-Z-_]+$/.test(customFieldId)) {
115-
return API.v1.failure('Invalid custom field name. Use only letters, numbers, hyphens and underscores.');
116-
}
117-
118114
if (customFieldId) {
119115
const customField = await LivechatCustomField.findOneById(customFieldId);
120116
if (!customField) {

packages/rest-typings/src/v1/omnichannel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4445,12 +4445,15 @@ const POSTLivechatSaveCustomFieldsSchema = {
44454445
properties: {
44464446
customFieldId: {
44474447
type: 'string',
4448+
pattern: '^[0-9a-zA-Z-_]+$',
4449+
nullable: true,
44484450
},
44494451
customFieldData: {
44504452
type: 'object',
44514453
properties: {
44524454
field: {
44534455
type: 'string',
4456+
pattern: '^[0-9a-zA-Z-_]+$',
44544457
},
44554458
label: {
44564459
type: 'string',

0 commit comments

Comments
 (0)