Hello. My request to Management API (Remove Roles from User) is not getting the body/data from the request I made.
My code:
const removeRole = this.httpService
.delete(`${auth0API}users/${userId}/roles`, {
headers: { Authorization: `Bearer ${token}` },
data: { data: {
roles: [`${role}`],
},},
})
.pipe(map(res => res.data))
.toPromise()
.catch(err => {
console.log(err);
throw new Error(err);
});
Response from auth0:
data: {
statusCode: 400,
error: 'Bad Request',
message: "Payload validation error: 'Expected type object but found type null'.",
errorCode: 'invalid_body'
}
Delete method from HttpService/Axios only takes two parameters. So I put it in config.data
Hope to help me soon.