import { startPasswordReset } from '@/modules/password-reset/services/password-reset.service';
import type { AppContext } from '@/types/hono';
import type { PasswordResetStartInput } from '@repo/api-contract';

export async function startPasswordResetHandler(c: AppContext) {
  const payload = c.req.valid('json' as never) as PasswordResetStartInput;

  const result = await startPasswordReset(payload);
  return c.json(result, 202);
}
