Pass whole user & organization to AJAX calls & get url link there

pull/2180/head
Jared Scheib 2017-11-09 22:10:51 -08:00
parent 1d48b05ed5
commit 331c6656c2
2 changed files with 6 additions and 6 deletions

View File

@ -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',

View File

@ -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)