Fakultas Ilmu Komputer UI

Commit 9bb70b1a authored by jahnsmichael's avatar jahnsmichael
Browse files

[GREEN] add new fetch hooks for forget password

parent ac8ba65e
......@@ -11,6 +11,7 @@ const END_POINTS = {
MONITORING_CASES: createEndpoint(["cases", "monitoring-cases"]),
LOGS: createEndpoint(["logs"]),
LOGIN: '/auth/token/',
FORGET_PASSWORD: '/accounts/set_random_password/',
};
enum Method {
......@@ -64,6 +65,10 @@ export default function useMainService(token: string) {
return fetchWithoutAuthentication(END_POINTS.LOGIN, Method.POST, body);
}
async function forgetPassword(body: object) {
return fetchWithoutAuthentication(END_POINTS.FORGET_PASSWORD, Method.POST, body);
}
async function me() {
const endPoint = END_POINTS.ACCOUNTS([
"me",
......@@ -259,6 +264,7 @@ export default function useMainService(token: string) {
return {
// Authentication
login,
forgetPassword,
createUser,
me,
// Contact Investigation Form
......
Supports Markdown
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