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

fix: update

parent f534c5d5
...@@ -134,11 +134,30 @@ export function fetchUser(id: number) { ...@@ -134,11 +134,30 @@ export function fetchUser(id: number) {
} }
/** /**
* GET ALL USERS * GET ALL USERS
* @param queryParams * @param userType
* @returns * @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 () => { return async () => {
dispatch(slice.actions.startLoading()); 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