From 34fe0732cda891a21c5e3c750f68bf3544be9f44 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" Date: Thu, 11 Jan 2024 13:21:22 +0200 Subject: [PATCH] Remove DELETE /users/:username/subscriptions/:subscriptionId endpoint Signed-off-by: Hung-Han (Henry) Chen --- src/UserService.ts | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/UserService.ts b/src/UserService.ts index 4950b92a..022db695 100644 --- a/src/UserService.ts +++ b/src/UserService.ts @@ -559,35 +559,6 @@ class UserService extends Base { return json as unknown as OfflineActivationCode; } - async deactivateSubscription({ - username, - license, - }: { - username: string; - license: Pick; - }): Promise { - const { apiEndpointAddress, fetch } = this.lensPlatformClient; - const url = `${apiEndpointAddress}/users/${username}/subscriptions/${license.subscriptionId}`; - - await throwExpected(async () => fetch.delete(url), { - 404(error) { - const message = error?.body.message; - - if (typeof message === "string") { - if (message.includes("User")) { - return new UserNameNotFoundException(username); - } - } - - return new NotFoundException(`Recurly subscription ${license.subscriptionId} not found`); - }, - 403: () => - new ForbiddenException(`Modification of user licenses for ${username} is forbidden`), - 400: () => new BadRequestException(), - 422: (error) => new UnprocessableEntityException(error?.body.message), - }); - } - async deactivateSubscriptionSeat({ username, license,