* Revert "Revert "chore: rename DWD to DelegationCredential (#19703)" (#19734)"
This reverts commit 340b5ab061.
* chore: fix schema and types for now
* fix: domainWideDelegationCredentialId error type
22 lines
682 B
TypeScript
22 lines
682 B
TypeScript
import type z from "zod";
|
|
|
|
import { DelegationCredentialRepository } from "@calcom/lib/server/repository/delegationCredential";
|
|
|
|
import { TRPCError } from "@trpc/server";
|
|
|
|
import type { DelegationCredentialDeleteSchema } from "./schema";
|
|
|
|
export default async function handler({
|
|
input,
|
|
}: {
|
|
input: z.infer<typeof DelegationCredentialDeleteSchema>;
|
|
}) {
|
|
const { id } = input;
|
|
|
|
// We might want to consider allowing this in the future. Right now, toggling off DelegationCredential achieves similar but non-destructive effect
|
|
throw new TRPCError({ code: "BAD_REQUEST", message: "Not allowed" });
|
|
await DelegationCredentialRepository.deleteById({ id });
|
|
|
|
return { id };
|
|
}
|