mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 17:26:38 +00:00
Merge dev into fix/log-analytics-adjustments
This commit is contained in:
@@ -11,16 +11,16 @@ import { OpenAPITags, registry } from "@server/openApi";
|
||||
import { getServerIp } from "@server/lib/serverIpService"; // your in-memory IP module
|
||||
|
||||
const getDNSRecordsSchema = z.strictObject({
|
||||
domainId: z.string(),
|
||||
orgId: z.string()
|
||||
});
|
||||
domainId: z.string(),
|
||||
orgId: z.string()
|
||||
});
|
||||
|
||||
async function query(domainId: string) {
|
||||
const records = await db
|
||||
.select()
|
||||
.from(dnsRecords)
|
||||
.where(eq(dnsRecords.domainId, domainId));
|
||||
|
||||
|
||||
return records;
|
||||
}
|
||||
|
||||
@@ -72,8 +72,11 @@ export async function getDNSRecords(
|
||||
const serverIp = getServerIp();
|
||||
|
||||
// Override value for type A or wildcard records
|
||||
const updatedRecords = records.map(record => {
|
||||
if ((record.recordType === "A" || record.baseDomain === "*") && serverIp) {
|
||||
const updatedRecords = records.map((record) => {
|
||||
if (
|
||||
(record.recordType === "A" || record.baseDomain === "*") &&
|
||||
serverIp
|
||||
) {
|
||||
return { ...record, value: serverIp };
|
||||
}
|
||||
return record;
|
||||
@@ -92,4 +95,4 @@ export async function getDNSRecords(
|
||||
createHttpError(HttpCode.INTERNAL_SERVER_ERROR, "An error occurred")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user