Fix: Newly created DNS records not appearing in the display table. Improved database query consistency and error handling.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/c498368e-812e-4074-a2b0-5b1c897c3ee4.jpg
This commit is contained in:
alphaeusmote
2025-04-11 02:38:58 +00:00
parent 344a433528
commit 0d8702d49e
2 changed files with 39 additions and 21 deletions
+6 -1
View File
@@ -82,11 +82,16 @@ export async function registerRoutes(app: Express): Promise<Server> {
return res.status(400).json({ message: "Domain ID is required" });
}
console.log(`API endpoint: Fetching DNS records for domain: ${domainId}`);
const records = await storage.getDnsRecordsByDomain(domainId);
console.log(`API endpoint: Retrieved ${records.length} DNS records from storage`);
res.json(records);
} catch (error) {
console.error("Error fetching DNS records:", error);
res.status(500).json({ message: "Internal server error" });
res.status(500).json({
message: "Failed to fetch DNS records",
error: error instanceof Error ? error.message : String(error)
});
}
});