-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#108] 사장님 예약/주문 API 연동 #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
8 changes: 8 additions & 0 deletions
8
apps/owner/src/shared/queries/mutation/owner/useApproveReservationMutation.ts
This file contains hidden or 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,8 @@ | ||
| import { useMutation, useQueryClient } from "@tanstack/react-query"; | ||
| import { ownerModule } from "@/shared/api/api"; | ||
|
|
||
| export const useApproveReservationMutation = () => { | ||
| const queryClient = useQueryClient(); | ||
|
|
||
| return useMutation(ownerModule.mutations.approveReservation(queryClient)); | ||
| }; |
8 changes: 8 additions & 0 deletions
8
apps/owner/src/shared/queries/mutation/owner/useRejectReservationMutation.ts
This file contains hidden or 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,8 @@ | ||
| import { useMutation, useQueryClient } from "@tanstack/react-query"; | ||
| import { ownerModule } from "@/shared/api/api"; | ||
|
|
||
| export const useRejectReservationMutation = () => { | ||
| const queryClient = useQueryClient(); | ||
|
|
||
| return useMutation(ownerModule.mutations.rejectReservation(queryClient)); | ||
| }; |
6 changes: 6 additions & 0 deletions
6
apps/owner/src/shared/queries/query/owner/usePendingReservationsQuery.ts
This file contains hidden or 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,6 @@ | ||
| import { useQuery } from "@tanstack/react-query"; | ||
| import { ownerModule } from "@/shared/api/api"; | ||
|
|
||
| export const usePendingReservationsQuery = () => { | ||
| return useQuery(ownerModule.queries.pendingReservations()); | ||
| }; |
6 changes: 6 additions & 0 deletions
6
apps/owner/src/shared/queries/query/owner/useProcessedReservationsQuery.ts
This file contains hidden or 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,6 @@ | ||
| import { useQuery } from "@tanstack/react-query"; | ||
| import { ownerModule } from "@/shared/api/api"; | ||
|
|
||
| export const useProcessedReservationsQuery = () => { | ||
| return useQuery(ownerModule.queries.processedReservations()); | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -6,14 +6,14 @@ import type { | |
| BusinessLicenseVerifyReqDTO, | ||
| OwnerUpgradeRespDTO, | ||
| ReservationListResponse, | ||
| ReservationReqDTO, | ||
| ReservationRejectReqDTO, | ||
| ReservationResponse, | ||
| SettlementPreviewDTO, | ||
| } from "../models/owner"; | ||
|
|
||
| export interface ReservationDecisionParams { | ||
| reservationId: number; | ||
| body?: ReservationReqDTO; | ||
| body?: ReservationRejectReqDTO; | ||
| } | ||
|
Comment on lines
14
to
17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🐛 제안 diff-export interface ReservationDecisionParams {
+export interface ApproveReservationParams {
reservationId: number;
- body?: ReservationRejectReqDTO;
+}
+
+export interface RejectReservationParams {
+ reservationId: number;
+ body: ReservationRejectReqDTO;
}
@@
- approveReservation: async ({ reservationId }: ReservationDecisionParams) => {
+ approveReservation: async ({ reservationId }: ApproveReservationParams) => {
@@
- }: ReservationDecisionParams) => {
+ }: RejectReservationParams) => {
const { data } = await api.privateClient.patch<ReservationResponse>(
`/owners/my-store/reservations/${reservationId}/reject`,
- body ?? {},
+ body,
);
return data;
},🤖 Prompt for AI Agents |
||
|
|
||
| export const createOwnerModule = (api: CompasserApi) => { | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
거절 요청 payload의 상태값이 잘못되어 있습니다.
Line [151]에서
status: "REQUESTED"를 보내면 거절 요청 의미와 충돌합니다. 이 값은 제거하거나, 서버가 필요로 하면REJECTED로 맞춰야 합니다.수정 예시
rejectMutation.mutate( { reservationId: rejectModal.orderId, body: { - status: "REQUESTED", - rejectReason: reason, + rejectReason: reason.trim(), }, },📝 Committable suggestion
🤖 Prompt for AI Agents