mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-27 18:57:28 +00:00
Improve domain management by using raw SQL queries for database interactions.
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/022cff8c-1cb5-4dc8-8647-65fb658bdd0c.jpg
This commit is contained in:
+4
-2
@@ -205,7 +205,8 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
|
||||
app.put("/api/domains/:id", requireRole(["admin", "manager"]), async (req, res) => {
|
||||
try {
|
||||
const id = parseInt(req.params.id);
|
||||
// Use id as string without parsing to int
|
||||
const id = req.params.id;
|
||||
const validatedData = insertDomainSchema.partial().parse(req.body);
|
||||
|
||||
const updatedDomain = await storage.updateDomain(id, validatedData);
|
||||
@@ -227,7 +228,8 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
|
||||
app.delete("/api/domains/:id", requireRole(["admin", "manager"]), async (req, res) => {
|
||||
try {
|
||||
const id = parseInt(req.params.id);
|
||||
// Use id as string without parsing
|
||||
const id = req.params.id;
|
||||
const deleted = await storage.deleteDomain(id);
|
||||
|
||||
if (!deleted) {
|
||||
|
||||
Reference in New Issue
Block a user