The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/tests/data/custom-fields.js

28 lines
607 B

import { getCredentials, request, api, credentials } from './api-data.js';
export const customFieldText = {
type: 'text',
required: true,
minLength: 2,
maxLength: 10,
};
export function setCustomFields(customFields, done) {
getCredentials((error) => {
if (error) {
return done(error);
}
const stringified = customFields ? JSON.stringify(customFields) : '';
request.post(api('settings/Accounts_CustomFields'))
.set(credentials)
.send({ value: stringified })
.expect(200)
.end(done);
});
}
export function clearCustomFields(done = () => {}) {
setCustomFields(null, done);
}