I am using axios to make http requests, I have a form data to be sent which i am passing as shown below
function addrequestData (token) {
const form = new FormData();
form.append('dateOfJoining', '360112000');
form.append('selectedGroups', JSON.stringify([1])); // [1] data has to be sent in a JSON format
form.append('jobLocation', '1' );
const httpHeaders = form.getHeaders();
httpHeaders.Authorization = token;
const httpObj = {
headers: httpHeaders,
url: '/admin/hr/addEmployeeBasicInfo',
data: form
};
const id = requestData(httpObj, false);
return id.then(({ userInfo }) => {
return userInfo['createdUserId'];
});
}
My question is How do I make sure that [1] gets converted to string in frisby?
I am using axios to make http requests, I have a form data to be sent which i am passing as shown below
function addrequestData (token) {
const form = new FormData();
form.append('dateOfJoining', '360112000');
form.append('selectedGroups', JSON.stringify([1])); // [1] data has to be sent in a JSON format
form.append('jobLocation', '1' );
}
My question is How do I make sure that [1] gets converted to string in frisby?