Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit e95d7d4

Browse files
committed
Call: deleteService mutation if we have ID as number; deleteServiceByUniqueName
if we have UniqueName.
1 parent ebe75ec commit e95d7d4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codestore",
33
"description": "code.store CLI. Add services, deploy, debug, perform all operations from your terminal.",
4-
"version": "1.9.14",
4+
"version": "1.9.15",
55
"bin": {
66
"codestore": "./bin/run",
77
"cs": "./bin/run"

src/commands/service/remove.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ export default class Remove extends Command {
2525
const tasks = new Listr<{}>([{
2626
title: `Removing service ${yellow(serviceId)}`,
2727
task: async (ctx, task): Promise<void> => {
28-
const { uniqueName } = await this.codestore.Service.getService(serviceId);
29-
await this.codestore.Service.deleteByUniqueName(uniqueName);
28+
// eslint-disable-next-line no-restricted-globals
29+
const isUniqueName = isNaN(serviceId);
30+
if (isUniqueName) {
31+
await this.codestore.Service.deleteByUniqueName(serviceId);
32+
} else {
33+
await this.codestore.Service.delete(serviceId);
34+
}
3035

3136
// eslint-disable-next-line no-param-reassign
3237
task.title = 'Service was successfully removed';

0 commit comments

Comments
 (0)