added get user by ID API

This commit was merged in pull request #47.
This commit is contained in:
victorAnumudu
2024-05-01 17:33:41 +01:00
parent 135cbce348
commit a97db9a661
4 changed files with 47 additions and 8 deletions
+23
View File
@@ -56,3 +56,26 @@ export function postAuxEnd(uri: string, reqData: any): Promise<any> {
}
});
}
export function getAuxEnd(uri: string, reqData: any): Promise<any> {
const endPoint = import.meta.env.VITE_USERS_ENDPOINT + uri;
const formData = new FormData();
for (let value in reqData) {
formData.append(value, reqData[value]);
}
return axios
.get(endPoint, reqData)
.then((response: {}) => {
// if (response.data.internal_return == "-9999") {
// localStorage.clear();
// window.location.href = `/login?sessionExpired=true`;
// }
return response;
})
.catch((error: any) => {
console.log(
"ERROR3-------------------------------------------------------", error
);
});
}