-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: 관리자 사이드바 -> 헤더로 변경 * feat: 관리자페이지 비고란 추가 * design: 태블릿 화면 스타일 수정 (스크롤, 높이 설정) * feat: 관리자/태블릿 주문시간 추가 * design: 태블릿 화면 css 수정 (반응형 디자인 추가) * feat: validation alert -> modal 변경 * feat: 관리자 주문 리스트 useInfiniteQuery로 수정 * feat: Intersection Observer 를 이용한 무한스크롤 구현 * feat: 관리자 페이지 주문 비고 기능 추가
- Loading branch information
Showing
26 changed files
with
526 additions
and
163 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { adminPatch } from "@apis/api"; | ||
import { QUERY_KEY } from "@apis/queryKeys/queryKeys"; | ||
import { useMutation, useQueryClient } from "@tanstack/react-query"; | ||
import { ErrorResponse, MutateResponseType } from "@types"; | ||
|
||
interface PatchOrderNote { | ||
orderId: number; | ||
note: string; | ||
} | ||
|
||
const patchOrderNote = async ({ | ||
orderId, | ||
note, | ||
}: PatchOrderNote): Promise<MutateResponseType> => { | ||
try { | ||
const response = await adminPatch<MutateResponseType>(`api/v1/order/note`, { | ||
orderId, | ||
note, | ||
}); | ||
return response.data; | ||
} catch (error) { | ||
const errorResponse = error as ErrorResponse; | ||
const errorData = errorResponse.response.data; | ||
throw errorData; | ||
} | ||
}; | ||
|
||
export const usePatchOrderNote = () => { | ||
const queryClient = useQueryClient(); | ||
return useMutation({ | ||
mutationFn: (date: PatchOrderNote) => patchOrderNote(date), | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ queryKey: [QUERY_KEY.ORDER_LIST] }); | ||
}, | ||
}); | ||
}; |
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
Oops, something went wrong.