fix: add toast and fix delete action (#5912)

Signed-off-by: Udit Takkar <[email protected]>

Signed-off-by: Udit Takkar <[email protected]>
This commit is contained in:
Udit Takkar authored and GitHub committed 2022-12-07 15:37:20 +01:00
1 parent 190db1a0f6
commit cc9b49131e
3 files changed
+12

No files matched your search

@@ -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 (