* Init * Add mock trpc context * Intro mockDatabaseClient * Introduce mockDatabaseClient class * Add delete video app test * Add calendar test * Remove unused func from bookingScenario * Remove console.log * Add app repository * Add createMany method to event type repository * Remove instance of MockDatabaseClient from video test * Add destination calendar repository * Remove instances of MockDatabaseClient * abstract logic to own handler * Remove dev dependency * Clean up * Type fix * Pull yarn.lock from main --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
19 lines
626 B
TypeScript
19 lines
626 B
TypeScript
import handleDeleteCredential from "@calcom/features/credentials/handleDeleteCredential";
|
|
import type { TrpcSessionUser } from "@calcom/trpc/server/trpc";
|
|
|
|
import type { TDeleteCredentialInputSchema } from "./deleteCredential.schema";
|
|
|
|
type DeleteCredentialOptions = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: TDeleteCredentialInputSchema;
|
|
};
|
|
|
|
export const deleteCredentialHandler = async ({ ctx, input }: DeleteCredentialOptions) => {
|
|
const { user } = ctx;
|
|
const { id, teamId } = input;
|
|
|
|
await handleDeleteCredential({ userId: user.id, userMetadata: user.metadata, credentialId: id, teamId });
|
|
};
|