mirror of
https://github.com/freedbygrace/DynamoDNS.git
synced 2026-08-21 06:56:37 +00:00
Improve data handling for proxied DNS records by adding a dedicated database field.
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/037e7f57-b24e-424e-971a-9b5d1af7101c.jpg
This commit is contained in:
@@ -636,12 +636,10 @@ export class DatabaseStorage implements IStorage {
|
|||||||
dbSafeFields['auto_update'] = isAutoIP;
|
dbSafeFields['auto_update'] = isAutoIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store proxied value in a metadata field if it's present
|
// Store proxied value in the proxied column if it's present
|
||||||
// Note: We don't have a dedicated proxied column, but we'll return it in the response
|
|
||||||
if (proxied !== undefined) {
|
if (proxied !== undefined) {
|
||||||
console.log(`[DEBUG] Setting metadata field for proxied to ${proxied}`);
|
console.log(`[DEBUG] Setting proxied field to ${proxied}`);
|
||||||
// You could store this in a 'metadata' JSON field if you have one
|
dbSafeFields['proxied'] = proxied;
|
||||||
// For now, we'll just remember to add it back to the response
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always update last_updated timestamp
|
// Always update last_updated timestamp
|
||||||
@@ -656,7 +654,7 @@ export class DatabaseStorage implements IStorage {
|
|||||||
SET last_updated = NOW()
|
SET last_updated = NOW()
|
||||||
WHERE id = $1
|
WHERE id = $1
|
||||||
RETURNING id, domain_id, name, type, content, ttl, priority,
|
RETURNING id, domain_id, name, type, content, ttl, priority,
|
||||||
provider_record_id, is_active, auto_update, notes, last_updated, created_at
|
provider_record_id, is_active, auto_update, notes, last_updated, created_at, proxied
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const simpleResult = await pool.query(simpleQueryText, [id]);
|
const simpleResult = await pool.query(simpleQueryText, [id]);
|
||||||
@@ -683,7 +681,7 @@ export class DatabaseStorage implements IStorage {
|
|||||||
notes: simpleRecord.notes,
|
notes: simpleRecord.notes,
|
||||||
lastUpdated: simpleRecord.last_updated,
|
lastUpdated: simpleRecord.last_updated,
|
||||||
createdAt: simpleRecord.created_at,
|
createdAt: simpleRecord.created_at,
|
||||||
proxied: proxiedValue // Use the proxied value from the input data or null
|
proxied: simpleRecord.proxied // Use the proxied value from the database
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -710,7 +708,7 @@ export class DatabaseStorage implements IStorage {
|
|||||||
SET ${setClause}
|
SET ${setClause}
|
||||||
WHERE id = $1
|
WHERE id = $1
|
||||||
RETURNING id, domain_id, name, type, content, ttl, priority,
|
RETURNING id, domain_id, name, type, content, ttl, priority,
|
||||||
provider_record_id, is_active, auto_update, notes, last_updated, created_at
|
provider_record_id, is_active, auto_update, notes, last_updated, created_at, proxied
|
||||||
`;
|
`;
|
||||||
|
|
||||||
console.log(`Executing update query with params:`, params);
|
console.log(`Executing update query with params:`, params);
|
||||||
@@ -739,7 +737,7 @@ export class DatabaseStorage implements IStorage {
|
|||||||
notes: updatedRecord.notes,
|
notes: updatedRecord.notes,
|
||||||
lastUpdated: updatedRecord.last_updated,
|
lastUpdated: updatedRecord.last_updated,
|
||||||
createdAt: updatedRecord.created_at,
|
createdAt: updatedRecord.created_at,
|
||||||
proxied: proxiedValue // Use the proxied value from the input data
|
proxied: updatedRecord.proxied // Use the proxied value from the database
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in updateDnsRecord:", error);
|
console.error("Error in updateDnsRecord:", error);
|
||||||
|
|||||||
Reference in New Issue
Block a user