import { i as defineEventHandler, y as getRouterParam, e as createError, M as removeSchedule } from '../../../nitro/nitro.mjs';
import 'node:path';
import 'node:module';
import 'node:fs';
import 'node:os';
import 'dotenv';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:crypto';
import 'node:async_hooks';
import 'node:url';
import 'node:net';
import '@iconify/utils';
import 'consola';

const _id__delete = defineEventHandler((event) => {
  const raw = getRouterParam(event, "id");
  const id = raw ? parseInt(raw, 10) : NaN;
  if (!Number.isInteger(id) || id < 1) {
    throw createError({ statusCode: 400, statusMessage: "Invalid schedule id" });
  }
  return removeSchedule(id);
});

export { _id__delete as default };
//# sourceMappingURL=_id_.delete.mjs.map
