File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
apps/meteor/app/livechat/server/api/v1
packages/rest-typings/src/v1 Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -111,10 +111,6 @@ const livechatCustomFieldsEndpoints = API.v1
111111 async function action ( ) {
112112 const { customFieldId, customFieldData } = this . bodyParams ;
113113
114- if ( ! / ^ [ 0 - 9 a - z A - 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 ) {
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments