mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-15 17:38:36 +01:00
new selfhosted version
This commit is contained in:
17
dashboard/server/api/shields/domains/delete.delete.ts
Normal file
17
dashboard/server/api/shields/domains/delete.delete.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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 };
|
||||
});
|
||||
Reference in New Issue
Block a user