fix: booking rejection message (#5497)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
co-authored by
Peer Richelsen
parent
2b91102f3f
commit
cbe358bb6b
@@ -43,9 +43,13 @@ function BookingListItem(booking: BookingItemProps) {
|
||||
const [rejectionReason, setRejectionReason] = useState<string>("");
|
||||
const [rejectionDialogIsOpen, setRejectionDialogIsOpen] = useState(false);
|
||||
const mutation = trpc.viewer.bookings.confirm.useMutation({
|
||||
onSuccess: () => {
|
||||
setRejectionDialogIsOpen(false);
|
||||
showToast(t("booking_confirmation_success"), "success");
|
||||
onSuccess: (data) => {
|
||||
if (data.status === BookingStatus.REJECTED) {
|
||||
setRejectionDialogIsOpen(false);
|
||||
showToast(t("booking_rejection_success"), "success");
|
||||
} else {
|
||||
showToast(t("booking_confirmation_success"), "success");
|
||||
}
|
||||
utils.viewer.bookings.invalidate();
|
||||
},
|
||||
onError: () => {
|
||||
|
||||
@@ -1295,6 +1295,7 @@
|
||||
"fetching_calendars_error": "There was a problem fetching your calendars. Please <1>try again</1> or reach out to customer support.",
|
||||
"calendar_connection_fail": "Calendar connection failed",
|
||||
"booking_confirmation_success": "Booking confirmation succeeded",
|
||||
"booking_rejection_success": "Booking rejection succeeded",
|
||||
"booking_confirmation_fail": "Booking confirmation failed",
|
||||
"we_wont_show_again": "We won't show this again",
|
||||
"couldnt_update_timezone": "We couldn't update the timezone",
|
||||
|
||||
@@ -731,7 +731,7 @@ export const bookingsRouter = router({
|
||||
},
|
||||
});
|
||||
|
||||
return { message: "Booking confirmed" };
|
||||
return { message: "Booking confirmed", status: BookingStatus.ACCEPTED };
|
||||
}
|
||||
const attendeesListPromises = booking.attendees.map(async (attendee) => {
|
||||
return {
|
||||
@@ -985,6 +985,10 @@ export const bookingsRouter = router({
|
||||
|
||||
await sendDeclinedEmails(evt);
|
||||
}
|
||||
return { message: "Booking " + confirmed ? "confirmed" : "rejected" };
|
||||
|
||||
const message = "Booking " + confirmed ? "confirmed" : "rejected";
|
||||
const status = confirmed ? BookingStatus.ACCEPTED : BookingStatus.REJECTED;
|
||||
|
||||
return { message, status };
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user