I'm using Graph API remove member API to delete a member from group. After successful deletion I'm not getting any kind of response from the api.
export async function removeGroupMember(accessToken, groupId, memberId) {
const client = getAuthenticatedClient(accessToken);
client
.api("/groups/" + groupId + "/members/" + memberId + "/$ref")
.delete()
.then((res) => {
console.log(res); //undefined
console.log(res.status); //undefined
});
}
I read in docs that it won't return any response body, but it will return a response code 204 on successful deletion. How can I get the response code?
Now the above code is doing the job, I'm able to remove a member using the above code, I verified in the Azure portal. But I need some kind of response in Frontend to let the user know that member is removed. For error handling purpose. I'm not sure if this is a Javascript question or Graph API, Azure AD question.