mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-09-05 14:23:17 +00:00
Removes case for preserving existing records
This commit is contained in:
+2
-14
@@ -43,6 +43,7 @@ const getDomainService = ({ Namecheap }) => {
|
||||
const key = getHostKey(host);
|
||||
return { ...acc, [key]: [ ...(acc[key] || []), host ] };
|
||||
}, {});
|
||||
|
||||
const updateHosts = async hosts => {
|
||||
const hostList = await getHosts();
|
||||
const remoteHostMap = toHostMap(hostList);
|
||||
@@ -58,7 +59,7 @@ const getDomainService = ({ Namecheap }) => {
|
||||
return [...acc, ...local];
|
||||
}, []);
|
||||
|
||||
await setHosts(newHostList);
|
||||
return setHosts(newHostList);
|
||||
};
|
||||
|
||||
return { getHosts, setHosts, updateHosts };
|
||||
@@ -69,16 +70,3 @@ module.exports = {
|
||||
domainService: getDomainService({ Namecheap }),
|
||||
};
|
||||
|
||||
//getDomainService({ Namecheap }).setHosts([
|
||||
//{ HostName: 'fuck', RecordType: 'CNAME', Address: 'google.com', TTL },
|
||||
//{ HostName: 'fuck.booboo.xyz', RecordType: 'URL', Address: 'https://fuck.booboo.xyz' },
|
||||
//{ HostName: 'foobar', RecordType: 'CNAME', Address: 'duckduckgo.com', TTL },
|
||||
//{ HostName: 'hello', RecordType: 'A', Address: '103.130.211.123', TTL },
|
||||
//]).then(console.log).catch(console.error);
|
||||
|
||||
//getDomainService({ Namecheap }).getHosts()
|
||||
//.then(console.log)
|
||||
//.catch(console.error);
|
||||
|
||||
//getDomainService({ Namecheap }).hasHost({ HostName: 'fuck', RecordType: 'CNAME', Address: 'duckduckgo.com' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user