Skip to content

Commit 0af98be

Browse files
committed
fix: use array args when calling DeleteSubdomain
There were two possible ways to fix this: change the calls (what this commit does) or change the deleteSubdomain function to use the rest operator. At first it looked like the spread operator was the correct change because that makes only one line of code incorrect vs two, however it was then realized that functions like `deleteSubdomain` adhere to an implied interface where the first argument to the function is always a list of command arguments, so this solution was picked instead.
1 parent f0cf652 commit 0af98be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/sites.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export async function infoSite(args = []) {
121121
}
122122

123123
const data = await response.json();
124-
const result = await deleteSubdomain(uuid);
124+
const result = await deleteSubdomain([uuid]);
125125
if (result){
126126
// check if data is empty object
127127
if (Object.keys(data).length === 0){
@@ -183,7 +183,7 @@ export async function infoSite(args = []) {
183183
} else {
184184
console.log(chalk.yellow(`However, It's linked to different directory at: ${subdomainObj.root_dir?.path}`));
185185
console.log(chalk.cyan(`We'll try to unlink this subdomain from that directory...`));
186-
const result = await deleteSubdomain(subdomainObj?.uid);
186+
const result = await deleteSubdomain([subdomainObj?.uid]);
187187
if (result) {
188188
console.log(chalk.green('Looks like this subdomain is free again, please try again.'));
189189
return;

0 commit comments

Comments
 (0)