Skip to content

Commit

Permalink
FE-51 🔀 공용 API 최신화 (충돌수정)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeonYumin94 committed Jul 30, 2024
1 parent 28c185d commit 95a8d50
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/apis/auth.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@

import type { PostSigninRequestType, PostSigninResponseType, PostSignUpRequestType, PostSignUpResponseType } from '@/schema/auth';
import httpClient from '.';

export const postSignin = async (request: PostSigninRequestType): Promise<PostSigninResponseType> => {

const response = await httpClient.post('/auth/signIn', request);
return response.data;
};


export const postSignup = async (request: PostSignUpRequestType): Promise<PostSignUpResponseType> => {
const response = await httpClient.post('/auth/signUp', request);
return response.data;
};

2 changes: 0 additions & 2 deletions src/hooks/useSignInMutation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

import { postSignin } from '@/apis/auth';

import { toast } from '@/components/ui/use-toast';
import { useMutation } from '@tanstack/react-query';
import { useRouter } from 'next/router';
Expand Down
2 changes: 0 additions & 2 deletions src/pages/auth/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default function SignIn() {
</Link>
</div>
<div className='flex gap-4'>

<Link href={`https://nid.naver.com/oauth2.0/authorize?client_id=${process.env.NEXT_PUBLIC_NAVER_CLIENT_ID}&redirect_uri=http://localhost:3000&response_type=code`}>
<Image src='/logo-naver.svg' alt='logo-naver' width={60} height={60} className='md:size-[60px] size-10' />
</Link>
Expand All @@ -95,7 +94,6 @@ export default function SignIn() {
<Link href={`https://kauth.kakao.com/oauth/authorize?client_id=${process.env.NEXT_PUBLIC_KAKAO_CLIENT_ID}&redirect_uri=${process.env.NEXT_PUBLIC_REDIRECT_URI}&response_type=code`}>
<Image src='/logo-kakao.svg' alt='logo-kakao' width={60} height={60} className='md:size-[60px] size-10' />
</Link>

</div>
</div>
);
Expand Down
5 changes: 0 additions & 5 deletions src/schema/auth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as z from 'zod';


const PWD_VALIDATION_REGEX = /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{8,}$/;

// NOTE: 회원가입 스키마
Expand Down Expand Up @@ -37,19 +36,15 @@ const User = z.object({
image: z.string(),
});


export const PostAuthResponse = z.object({

accessToken: z.string(),
refreshToken: z.string(),
user: User,
});


// NOTE: 회원가입 타입
export type PostSignUpRequestType = z.infer<typeof PostSignUpRequest>;
export type PostSignUpResponseType = z.infer<typeof PostAuthResponse>;
// NOTE: 로그인 타입
export type PostSigninRequestType = z.infer<typeof PostSigninRequest>;
export type PostSigninResponseType = z.infer<typeof PostAuthResponse>;

0 comments on commit 95a8d50

Please sign in to comment.