mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
update shields
This commit is contained in:
14
dashboard/server/api/shields/countries/delete.delete.ts
Normal file
14
dashboard/server/api/shields/countries/delete.delete.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { CountryBlacklistModel } from "~/shared/schema/shields/CountryBlacklistSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestData(event, [], ['OWNER']);
|
||||
if (!data) return;
|
||||
|
||||
const body = await readBody(event);
|
||||
const { country } = body;
|
||||
|
||||
const removal = await CountryBlacklistModel.deleteOne({ project_id: data.project_id, country });
|
||||
|
||||
return { ok: removal.deletedCount == 1 };
|
||||
});
|
||||
Reference in New Issue
Block a user