From 7158591a7949ffd72dc6b93decc19fb276faafae Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Thu, 4 Apr 2024 08:49:47 -0400 Subject: [PATCH] fix(shared-drives): use correct endpoints for delete and get --- commands/shared-drive/delete/mod.ts | 18 +++++++++--------- commands/shared-drive/get/mod.ts | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/commands/shared-drive/delete/mod.ts b/commands/shared-drive/delete/mod.ts index f4e190d..588c0d4 100644 --- a/commands/shared-drive/delete/mod.ts +++ b/commands/shared-drive/delete/mod.ts @@ -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"; /** @@ -15,13 +15,13 @@ import { defaultFields } from "../mod.ts"; const subCommands: ReturnType[] = []; 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, @@ -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); diff --git a/commands/shared-drive/get/mod.ts b/commands/shared-drive/get/mod.ts index 1df7dfb..5921a42 100644 --- a/commands/shared-drive/get/mod.ts +++ b/commands/shared-drive/get/mod.ts @@ -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"; /** @@ -15,13 +15,13 @@ import { defaultFields } from "../mod.ts"; const subCommands: ReturnType[] = []; 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, @@ -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);