mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
16 lines
445 B
TypeScript
16 lines
445 B
TypeScript
|
|
import { ApiSettingsModel } from "@schema/ApiSettingsSchema";
|
|
|
|
export default defineEventHandler(async event => {
|
|
|
|
const body = await readBody(event);
|
|
|
|
const data = await getRequestData(event, { allowGuests: false, allowLitlyx: false, });
|
|
if (!data) return;
|
|
|
|
const { project_id } = data;
|
|
|
|
const deletation = await ApiSettingsModel.deleteOne({ project_id, _id: body.api_id });
|
|
return { ok: deletation.acknowledged };
|
|
|
|
}); |