mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-16 17:48:36 +01:00
new selfhosted version
This commit is contained in:
18
dashboard/server/api/shields/domains/list.ts
Normal file
18
dashboard/server/api/shields/domains/list.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
import { DomainWhitelistModel } from "~/shared/schema/shields/DomainWhitelistSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const ctx = await getRequestContext(event, 'pid');
|
||||
|
||||
const { project_id } = ctx;
|
||||
|
||||
const whitelist = await DomainWhitelistModel.findOne({
|
||||
project_id
|
||||
});
|
||||
|
||||
if (!whitelist) return [];
|
||||
|
||||
return whitelist.domains;
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user