Files
agentic-dev/packages/core-consent/src/handlers/withdraw.handler.ts
2026-07-12 08:15:46 +00:00

19 lines
463 B
TypeScript

import { z } from "zod";
import type { IConsent } from "../consent.interface";
export const withdrawHandlerInputSchema = z
.object({
category: z.string().min(1),
})
.strict();
export type WithdrawHandlerInput = z.infer<typeof withdrawHandlerInputSchema>;
export async function withdrawHandler(
consent: IConsent,
input: WithdrawHandlerInput,
): Promise<{ success: true }> {
await consent.withdraw(input.category);
return { success: true };
}