You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
984 B
50 lines
984 B
import { |
|
IS_SENDING_USER_REQUEST, |
|
SET_USER_REQUEST_ERROR, |
|
CLEAR_USER_REQUEST_ERROR, |
|
SET_USER_REQUEST_SUCCESS, |
|
CLEAR_USER_REQUEST_SUCCESS, |
|
SET_SELF_USER |
|
} from "../../constants/user.constants"; |
|
import { parseError } from "../common.actions"; |
|
|
|
export function isSendingUserRequest(sendingRequest) { |
|
return { |
|
type: IS_SENDING_USER_REQUEST, |
|
data: sendingRequest |
|
}; |
|
} |
|
|
|
export function setUserRequestError(exception) { |
|
let error = parseError(exception); |
|
return { |
|
type: SET_USER_REQUEST_ERROR, |
|
data: error |
|
}; |
|
} |
|
|
|
export function clearUserRequestError() { |
|
return { |
|
type: CLEAR_USER_REQUEST_ERROR |
|
}; |
|
} |
|
|
|
export function setUserRequestSuccess(response) { |
|
return { |
|
type: SET_USER_REQUEST_SUCCESS, |
|
data: response.detail || response |
|
}; |
|
} |
|
|
|
export function clearUserRequestSuccess() { |
|
return { |
|
type: CLEAR_USER_REQUEST_SUCCESS |
|
}; |
|
} |
|
|
|
export function setSelfUser(selfUser) { |
|
return { |
|
type: SET_SELF_USER, |
|
data: selfUser |
|
}; |
|
}
|
|
|