fix: add toast and fix delete action (#5912)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in> Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>pull/5911/head^2
parent
190db1a0f6
commit
cc9b49131e
|
@ -22,6 +22,7 @@ import {
|
|||
SkeletonButton,
|
||||
SkeletonContainer,
|
||||
SkeletonText,
|
||||
showToast,
|
||||
} from "@calcom/ui";
|
||||
|
||||
import { QueryCell } from "@lib/QueryCell";
|
||||
|
@ -66,6 +67,12 @@ const CalendarsView = () => {
|
|||
async onSettled() {
|
||||
await utils.viewer.connectedCalendars.invalidate();
|
||||
},
|
||||
onSuccess: async () => {
|
||||
showToast(t("calendar_updated_successfully"), "success");
|
||||
},
|
||||
onError: () => {
|
||||
showToast(t("unexpected_error_try_again"), "error");
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
@ -747,6 +747,7 @@
|
|||
"toggle_calendars_conflict": "Toggle the calendars you want to check for conflicts to prevent double bookings.",
|
||||
"select_destination_calendar": "Create events on",
|
||||
"connect_additional_calendar": "Connect additional calendar",
|
||||
"calendar_updated_successfully":"Calendar updated successfully",
|
||||
"conferencing": "Conferencing",
|
||||
"calendar": "Calendar",
|
||||
"payments": "Payments",
|
||||
|
|
|
@ -31,6 +31,7 @@ export default function DisconnectIntegration({
|
|||
}) {
|
||||
const { t } = useLocale();
|
||||
const [modalOpen, setModalOpen] = useState(false);
|
||||
const utils = trpc.useContext();
|
||||
|
||||
const mutation = trpc.viewer.deleteCredential.useMutation({
|
||||
onSuccess: () => {
|
||||
|
@ -42,6 +43,9 @@ export default function DisconnectIntegration({
|
|||
showToast(t("error_removing_app"), "error");
|
||||
setModalOpen(false);
|
||||
},
|
||||
async onSettled() {
|
||||
await utils.viewer.connectedCalendars.invalidate();
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue