Pass whole user & organization to AJAX calls & get url link there
parent
1d48b05ed5
commit
331c6656c2
|
@ -151,7 +151,7 @@ export const updateUserAsync = (user, updatedUser) => async dispatch => {
|
|||
export const deleteUserAsync = user => async dispatch => {
|
||||
dispatch(removeUser(user))
|
||||
try {
|
||||
await deleteUserAJAX(user.links.self)
|
||||
await deleteUserAJAX(user)
|
||||
dispatch(
|
||||
publishAutoDismissingNotification(
|
||||
'success',
|
||||
|
@ -197,7 +197,7 @@ export const renameOrganizationAsync = (
|
|||
export const deleteOrganizationAsync = organization => async dispatch => {
|
||||
dispatch(removeOrganization(organization))
|
||||
try {
|
||||
await deleteOrganizationAJAX(organization.links.self)
|
||||
await deleteOrganizationAJAX(organization)
|
||||
dispatch(
|
||||
publishAutoDismissingNotification(
|
||||
'success',
|
||||
|
|
|
@ -53,11 +53,11 @@ export const updateUser = async updatedUserWithRolesOnly => {
|
|||
}
|
||||
}
|
||||
|
||||
export const deleteUser = async url => {
|
||||
export const deleteUser = async user => {
|
||||
try {
|
||||
return await AJAX({
|
||||
method: 'DELETE',
|
||||
url,
|
||||
url: user.links.self,
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
@ -91,11 +91,11 @@ export const renameOrganization = async organization => {
|
|||
}
|
||||
}
|
||||
|
||||
export const deleteOrganization = async url => {
|
||||
export const deleteOrganization = async organization => {
|
||||
try {
|
||||
return await AJAX({
|
||||
method: 'DELETE',
|
||||
url,
|
||||
url: organization.links.self,
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
|
Loading…
Reference in New Issue