Skip to content

Commit

Permalink
fix(shared-drives): use correct endpoints for delete and get (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
ps-kwang authored Apr 5, 2024
1 parent 31296df commit 2e63004
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions commands/shared-drive/delete/mod.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { sharedDrives } from "../../../api/shared-drives.ts";
import { fields } from "../../../flags.ts";
import { asserts } from "../../../lib/asserts.ts";
import { dataTable } from "../../../lib/data-table.ts";
import { loading } from "../../../lib/loading.ts";
import { pickJson } from "../../../lib/pick-json.ts";
import { input } from "../../../prompts/input.ts";
import { args, command, flags, z } from "../../../zcli.ts";
import { dataTable } from "../../../lib/data-table.ts";
import { fields } from "../../../flags.ts";
import { pickJson } from "../../../lib/pick-json.ts";
import { templates } from "../../../api/templates.ts";
import { defaultFields } from "../mod.ts";

/**
Expand All @@ -15,13 +15,13 @@ import { defaultFields } from "../mod.ts";
const subCommands: ReturnType<typeof command>[] = [];

export const del = command("delete", {
short: "Delete a template",
short: "Delete a shared drive",
long: `
Delete a template from a team.
Delete a shared drive from a team.
`,
commands: subCommands,
args: args().tuple([
z.string().describe("The ID of the template to delete"),
z.string().describe("The ID of the shared drive to delete"),
]).optional(),
flags: flags({
fields,
Expand All @@ -40,11 +40,11 @@ export const del = command("delete", {
id = await input("ID:", {
filter: (v) => !!v.sequence.match(/[a-zA-Z0-9_-]/),
});
asserts(id, "A template ID is required");
asserts(id, "A shared drive ID is required");
}

const response = await loading(
templates.delete({ id }),
sharedDrives.delete({ id }),
);

asserts(response.ok, response);
Expand Down
18 changes: 9 additions & 9 deletions commands/shared-drive/get/mod.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { sharedDrives } from "../../../api/shared-drives.ts";
import { fields } from "../../../flags.ts";
import { asserts } from "../../../lib/asserts.ts";
import { dataTable } from "../../../lib/data-table.ts";
import { loading } from "../../../lib/loading.ts";
import { pickJson } from "../../../lib/pick-json.ts";
import { input } from "../../../prompts/input.ts";
import { args, command, flags, z } from "../../../zcli.ts";
import { dataTable } from "../../../lib/data-table.ts";
import { fields } from "../../../flags.ts";
import { pickJson } from "../../../lib/pick-json.ts";
import { templates } from "../../../api/templates.ts";
import { defaultFields } from "../mod.ts";

/**
Expand All @@ -15,13 +15,13 @@ import { defaultFields } from "../mod.ts";
const subCommands: ReturnType<typeof command>[] = [];

export const get = command("get", {
short: "Get a template",
short: "Get a shared drive",
long: `
Get a template from a team.
Get a shared drive from a team.
`,
commands: subCommands,
args: args().tuple([
z.string().describe("The ID of the template to get"),
z.string().describe("The ID of the shared drive to get"),
]).optional(),
flags: flags({
fields,
Expand All @@ -40,11 +40,11 @@ export const get = command("get", {
id = await input("ID:", {
filter: (v) => !!v.sequence.match(/[a-zA-Z0-9_-]/),
});
asserts(id, "A template ID is required");
asserts(id, "A shared drive ID is required");
}

const response = await loading(
templates.get({ id }),
sharedDrives.get({ id }),
);

asserts(response.ok, response);
Expand Down

0 comments on commit 2e63004

Please sign in to comment.