diff --git a/README.md b/README.md index 38eb1c57..dc020153 100644 --- a/README.md +++ b/README.md @@ -754,38 +754,38 @@ await clockodo.editUser({ id: 33, name: "Moalo Loco" }); ## Delete methods -### deactivateCustomer() +### deleteCustomer() -Deactivates (not deletes) customer. +Deletes the customer. #### Example: ```js -await clockodo.deactivateCustomer({ id: 343 }); +await clockodo.deleteCustomer({ id: 343 }); ``` --- -### deactivateProject() +### deleteProject() -Deactivates (not deletes) project. +Deletes the project. #### Example: ```js -await clockodo.deactivateProject({ id: 8 }); +await clockodo.deleteProject({ id: 8 }); ``` --- -### deactivateService() +### deleteService() -Deactivates (not deletes) service. +Deletes the service. #### Example: ```js -await clockodo.deactivateService({ id: 94 }); +await clockodo.deleteService({ id: 94 }); ``` --- diff --git a/src/clockodo.test.ts b/src/clockodo.test.ts index 8c955ade..f58e7a94 100644 --- a/src/clockodo.test.ts +++ b/src/clockodo.test.ts @@ -1054,37 +1054,37 @@ describe("Clockodo (instance)", () => { }); }); - describe("deactivateCustomer()", () => { - it("correctly builds deactivateCustomer() request", async () => { + describe("deleteCustomer()", () => { + it("correctly builds deleteCustomer() request", async () => { const nockScope = nock(CLOCKODO_API) .delete("/v2/customers/343") .reply(200, {}); - await clockodo.deactivateCustomer({ id: 343 }); + await clockodo.deleteCustomer({ id: 343 }); nockScope.done(); }); }); - describe("deactivateProject()", () => { - it("correctly builds deactivateProject() request", async () => { + describe("deleteProject()", () => { + it("correctly builds deleteProject() request", async () => { const nockScope = nock(CLOCKODO_API) .delete("/v2/projects/8") .reply(200, {}); - await clockodo.deactivateProject({ id: 8 }); + await clockodo.deleteProject({ id: 8 }); nockScope.done(); }); }); - describe("deactivateService()", () => { - it("correctly builds deactivateService() request", async () => { + describe("deleteService()", () => { + it("correctly builds deleteService() request", async () => { const nockScope = nock(CLOCKODO_API) .delete("/services/94") .reply(200, {}); - await clockodo.deactivateService({ id: 94 }); + await clockodo.deleteService({ id: 94 }); nockScope.done(); }); diff --git a/src/clockodo.ts b/src/clockodo.ts index dbce4e08..b2186f85 100644 --- a/src/clockodo.ts +++ b/src/clockodo.ts @@ -557,30 +557,30 @@ export class Clockodo { return this.api.put("/v2/users/" + id, params); } - async deactivateCustomer( - params: Params> + async deleteCustomer( + params: Params> ): Promise { - REQUIRED.checkRequired(params, REQUIRED.DEACTIVATE_CUSTOMER); + REQUIRED.checkRequired(params, REQUIRED.DELETE_CUSTOMER); const { id } = params; return this.api.delete("/v2/customers/" + id, params); } - async deactivateProject( - params: Params> + async deleteProject( + params: Params> ): Promise { - REQUIRED.checkRequired(params, REQUIRED.DEACTIVATE_PROJECT); + REQUIRED.checkRequired(params, REQUIRED.DELETE_PROJECT); const { id } = params; return this.api.delete("/v2/projects/" + id, params); } - async deactivateService( - params: Params> + async deleteService( + params: Params> ): Promise { - REQUIRED.checkRequired(params, REQUIRED.DEACTIVATE_SERVICE); + REQUIRED.checkRequired(params, REQUIRED.DELETE_SERVICE); const { id } = params; diff --git a/src/lib/requiredParams.ts b/src/lib/requiredParams.ts index 08bb66a3..5b1352ab 100644 --- a/src/lib/requiredParams.ts +++ b/src/lib/requiredParams.ts @@ -30,9 +30,9 @@ export const CHANGE_CLOCK_DURATION = [ "durationBefore", "duration", ] as const; -export const DEACTIVATE_CUSTOMER = ["id"] as const; -export const DEACTIVATE_PROJECT = ["id"] as const; -export const DEACTIVATE_SERVICE = ["id"] as const; +export const DELETE_CUSTOMER = ["id"] as const; +export const DELETE_PROJECT = ["id"] as const; +export const DELETE_SERVICE = ["id"] as const; export const DELETE_USER = ["id"] as const; export const DELETE_ENTRY = ["id"] as const; export const DELETE_ENTRY_GROUP = ["timeSince", "timeUntil"] as const;