Skip to content

Commit

Permalink
chore: clean up ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
willswire committed Jan 23, 2025
1 parent 8f73cdc commit 6ad4a62
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function update(clientOptions: ClientOptions, newRecord: AddressableRecord
const records = (
await cloudflare.dns.records.list({
zone_id: zone.id,
name: newRecord.name,
name: newRecord.name as any,
type: newRecord.type,
})
).result;
Expand All @@ -92,12 +92,12 @@ async function update(clientOptions: ClientOptions, newRecord: AddressableRecord
await cloudflare.dns.records.update(records[0].id, {
content: newRecord.content,
zone_id: zone.id,
name: newRecord.name,
name: newRecord.name as any,
type: newRecord.type,
proxied, // Pass the existing "proxied" status
});

console.log('DNS record for ' + newRecord.name + '(' + newRecord.type +') updated successfully to ' + newRecord.content);
console.log('DNS record for ' + newRecord.name + '(' + newRecord.type + ') updated successfully to ' + newRecord.content);

return new Response('OK', { status: 200 });
}
Expand All @@ -107,9 +107,7 @@ export default {
const url = new URL(request.url);
console.log('Requester IP: ' + request.headers.get('CF-Connecting-IP'));
console.log(request.method + ': ' + request.url);
if (request.body) {
console.log('Body: ' + await request.text());
}
console.log('Body: ' + (await request.text()));

try {
// Construct client options and DNS record
Expand Down

0 comments on commit 6ad4a62

Please sign in to comment.