-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ 미구현 페이지들 구현 및 버그 수정
- Loading branch information
Showing
34 changed files
with
679 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
import { ICategoryParams, IDeleteCategory, IPostCategory, IPutCategory } from "@/types/dto"; | ||
import { defaultInstance } from "."; | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { ICategoryParams, IDeleteCategory, IPostCategory, IPutCategory } from '@/types/dto'; | ||
import { defaultInstance } from '.'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
//카테고리 이름/pr연동여부 가져오기 | ||
export const GetCategoryApi = async (params: ICategoryParams) => { | ||
const { data } = await defaultInstance.get('/category', { params }); | ||
return data; | ||
const { data } = await defaultInstance.get('/category', { params }); | ||
|
||
return data; | ||
}; | ||
export const useGetCategoryQuery = (params: ICategoryParams) => { | ||
const { isLoading, error, data } = useQuery(['category', params], () => GetCategoryApi(params)); | ||
return { isLoading, error, data }; | ||
|
||
export const useGetCategoryQuery = (params: ICategoryParams) => { | ||
const { isLoading, error, data } = useQuery(['category', params], () => GetCategoryApi(params)); | ||
|
||
return { isLoading, error, data }; | ||
}; | ||
|
||
//카테고리 생성 | ||
export const PostCategoryApi = async (body: IPostCategory) => { | ||
const { data } = await defaultInstance.post('/category', body); | ||
return data; | ||
const { data } = await defaultInstance.post('/category', body); | ||
return data; | ||
}; | ||
|
||
//카테고리 이름 수정 | ||
export const PutCategoryApi = async (body: IPutCategory) => { | ||
const { data } = await defaultInstance.put('/category', body); | ||
return data; | ||
const { data } = await defaultInstance.put('/category', body); | ||
return data; | ||
}; | ||
|
||
//카테고리 삭제 | ||
export const DeleteCategoryApi = async (params: IDeleteCategory) => { | ||
const { data } = await defaultInstance.delete('/category', { | ||
params, | ||
}); | ||
return data; | ||
}; | ||
const { data } = await defaultInstance.delete('/category', { | ||
params, | ||
}); | ||
return data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { useQuery } from "@tanstack/react-query"; | ||
import { defaultInstance } from "."; | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { defaultInstance } from '.'; | ||
|
||
export const GetUserDetailApi = async () => { | ||
const {data} = await defaultInstance.get('/user/detail'); | ||
return data; | ||
}; | ||
export const useGetUserDetailQuery = () => { | ||
const {isLoading, error, data } = useQuery(['userDetail'], () => GetUserDetailApi()); | ||
return {isLoading, error, data }; | ||
}; | ||
const { data } = await defaultInstance.get('/user/detail'); | ||
|
||
return data; | ||
}; | ||
|
||
export const useGetUserDetailQuery = () => { | ||
const { isLoading, error, data } = useQuery(['userDetail'], () => GetUserDetailApi()); | ||
|
||
return { isLoading, error, data }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.