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

fix: update

parent f534c5d5
......@@ -134,11 +134,30 @@ export function fetchUser(id: number) {
}
/**
* GET ALL USERS
* @param queryParams
* GET ALL USERS
* @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