Commit 5dbca9e9 authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

parent f534c5d5
......@@ -135,10 +135,29 @@ export function fetchUser(id: number) {
/**
* GET ALL USERS
* @param queryParams
* @param userType
* @returns
*/
export function fetchUsers() {
export function fetchUsers(userType: string) {
return async () => {
dispatch(slice.actions.startLoading());
try {
const response = await axiosServices.get(`/user/all/type/${userType}`);
dispatch(slice.actions.fetchUsersSuccess(response.data));
} catch (error) {
dispatch(slice.actions.hasError(error));
} finally {
dispatch(slice.actions.finishLoading());
}
};
}
/**
* GET ALL USERS BY TYPE
* @returns
*/
export function fetchUsersByType() {
return async () => {
dispatch(slice.actions.startLoading());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment