mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat: added zoom, office365-video as valid event-type locations * added docs * Update stripe.service.ts * enable conferencing apps for teams initial commit * fix: make conferencing atom work with teams * update team events in bulk update default location * feat: Separate endpoints for team conferencing apps instead of query params * Display all team events in 'Bulk update existing event types' modal when conferencing atom is enabled for Teams * fix: bulk update default location for team events * removed the organizations endpoints * Refactor: Separate functions for team events to follow SRP * undo extra changes * undo extra changes * fix: platform libraries build breaking * feat: only allow integrations which are installed in create/update team/user event-type endpoints * fix: merge conflicts * remove redundant imports * Update ConferencingAppsViewPlatformWrapper.tsx * Update useBanners.ts * fix: axios error response interceptor * feat: update :app param docs in `organizations-conferencing.controller` * Revert "fix: axios error response interceptor" This reverts commit 729eac3eee9f81c19b5368bbae4b1666884221fd. * Update useAtomsGetInstalledConferencingApps.ts * upgrade platform libraries * Update apps.ts --------- Co-authored-by: Morgan <[email protected]> Co-authored-by: Morgan Vernay <[email protected]>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
|
|
import { SUCCESS_STATUS } from "@calcom/platform-constants";
|
|
import type { App } from "@calcom/types/App";
|
|
|
|
import { useAtomsContext } from "../../../hooks/useAtomsContext";
|
|
import http from "../../../lib/http";
|
|
|
|
export const QUERY_KEY = "use-delete-credential";
|
|
export type UseDeleteEventTypeProps = {
|
|
onSuccess?: () => void;
|
|
onError?: (err: Error) => void;
|
|
onSettled?: () => void;
|
|
teamId?: number;
|
|
};
|
|
export const useDeleteCredential = ({ onSuccess, onError, onSettled, teamId }: UseDeleteEventTypeProps) => {
|
|
const { organizationId } = useAtomsContext();
|
|
return useMutation({
|
|
onSuccess,
|
|
onError,
|
|
onSettled,
|
|
mutationFn: (app: App["slug"]) => {
|
|
if (!app) throw new Error("app is required");
|
|
|
|
let pathname = `/conferencing/${app}/disconnect`;
|
|
|
|
if (teamId) {
|
|
pathname = `/organizations/${organizationId}/teams/${teamId}/conferencing/${app}/disconnect`;
|
|
}
|
|
return http?.delete(pathname).then((res) => {
|
|
if (res.data.status === SUCCESS_STATUS) {
|
|
return;
|
|
}
|
|
throw new Error(res.data.error.message);
|
|
});
|
|
},
|
|
});
|
|
};
|