Skip to content

Commit

Permalink
Remove DELETE /users/:username/subscriptions/:subscriptionId endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Hung-Han (Henry) Chen <[email protected]>
  • Loading branch information
chenhunghan committed Jan 11, 2024
1 parent 204cf47 commit 34fe073
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,35 +559,6 @@ class UserService extends Base {
return json as unknown as OfflineActivationCode;
}

async deactivateSubscription({
username,
license,
}: {
username: string;
license: Pick<License, "subscriptionId">;
}): Promise<void> {
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,
Expand Down

0 comments on commit 34fe073

Please sign in to comment.