Skip to content

Commit

Permalink
change:Tres to Tbody
Browse files Browse the repository at this point in the history
  • Loading branch information
jevil25 committed Sep 28, 2023
1 parent bfd54df commit 4d14f2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const Login = (props: { forgot?: boolean }) => {
// replaces button with spinner
setLoading(true);

const { res, data, error } = await request(routes.login, {
const { res, data } = await request(routes.login, {
body: { ...valid },
});
if (res && res.status === 429) {
Expand Down
17 changes: 13 additions & 4 deletions src/Redux/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ interface JwtTokenObtainPair {
refresh: string;
}

interface LoginInput {
username: string;
password: string;
}

const routes = {
config: {
path: import.meta.env.REACT_APP_CONFIG ?? "/config.json",
Expand All @@ -30,7 +35,8 @@ const routes = {
path: "/api/v1/auth/login/",
method: "POST",
noAuth: true,
TRes: Res<JwtTokenObtainPair>(),
TRes: Type<JwtTokenObtainPair>(),
TBody: Type<LoginInput>(),
},

token_refresh: {
Expand All @@ -48,19 +54,22 @@ const routes = {
checkResetToken: {
path: "/api/v1/password_reset/check/",
method: "POST",
TRes: Res<any>(),
TRes: Type<any>(),
TBody: Type<{ token: string }>(),
},

resetPassword: {
path: "/api/v1/password_reset/confirm/",
method: "POST",
TRes: Res<any>(),
TRes: Type<any>(),
TBody: Type<{ password: string; confirm: string }>(),
},

forgotPassword: {
path: "/api/v1/password_reset/",
method: "POST",
TRes: Res<any>(),
TRes: Type<any>(),
TBody: Type<{ username: string }>(),
},

updatePassword: {
Expand Down

0 comments on commit 4d14f2b

Please sign in to comment.