mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 16:28:37 +01:00
17 lines
481 B
TypeScript
17 lines
481 B
TypeScript
import { DomainWhitelistModel } from "~/shared/schema/shields/DomainWhitelistSchema";
|
|
|
|
export default defineEventHandler(async event => {
|
|
|
|
const ctx = await getRequestContext(event, 'pid');
|
|
|
|
const { project_id } = ctx;
|
|
|
|
const body = await readBody(event);
|
|
const { domain } = body;
|
|
|
|
const removal = await DomainWhitelistModel.updateOne({ project_id: project_id },
|
|
{ $pull: { domains: domain } },
|
|
);
|
|
|
|
return { ok: removal.modifiedCount == 1 };
|
|
}); |