Add update record endpoint #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-update-record-endpoint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The server manager will need an endpoint where it can update existing DNS records, for example if the IP address of the server changes.
Solution
Implemented and endpoint to update an existing DNS record. Found that supplying an invalid record id (not a valid uuid) could cause the server to throw and return 500. When the client supplies incorrect data, the server must return a 400, so implemented a middleware that validates the record id before the controller operates on it.
WIP: Add tests for update record endpointto WIP: Add update record endpoint@ -0,0 +30,4 @@content: updated.content,ttl: updated.ttl,priority: updated.priority,notes: updated.notes,I explicitly set the properties here so that extra properties in the update object don't get saved to the database. Otherwise someone could supply a property like
domainIdin their request and the server would change which domain a record was for 😬WIP: Add update record endpointto Add update record endpoint