mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 00:08:37 +01:00
shields update
This commit is contained in:
18
dashboard/server/api/shields/domains/delete.delete.ts
Normal file
18
dashboard/server/api/shields/domains/delete.delete.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { DomainWhitelistModel } from "~/shared/schema/shields/DomainWhitelistSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event, [], ['OWNER']);
|
||||
if (!data) return;
|
||||
|
||||
const body = await readBody(event);
|
||||
const { domain } = body;
|
||||
|
||||
const removal = await DomainWhitelistModel.updateOne({
|
||||
project_id: data.project_id
|
||||
},
|
||||
{ $pull: { domains: domain } },
|
||||
);
|
||||
|
||||
return { ok: removal.modifiedCount == 1 };
|
||||
});
|
||||
Reference in New Issue
Block a user