Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/services/objectStorage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ export class ObjectStorageService {
await this.axios.put(`${this.config.OBJECT_STORAGE_URL}/users/${payload.customerId}/deactivate`, {}, params);
}

async deleteAccount(payload: { customerId: string }): Promise<void> {
const jwt = signToken('5m', this.config.OBJECT_STORAGE_GATEWAY_SECRET);
const params: AxiosRequestConfig = {
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${jwt}`,
},
};

await this.axios.delete(`${this.config.OBJECT_STORAGE_URL}/users/${payload.customerId}`, params);
}

private async createUser(email: string, customerId: string): Promise<void> {
const jwt = signToken('5m', this.config.OBJECT_STORAGE_GATEWAY_SECRET);
const params: AxiosRequestConfig = {
Expand Down
2 changes: 1 addition & 1 deletion src/webhooks/handleSubscriptionCanceled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function handleObjectStorageSubscriptionCancelled(

logger.info(`Deleting object storage customer ${customer.id} with sub ${subscription.id}`);

await objectStorageService.deleteAccount({
await objectStorageService.suspendAccount({
customerId: customer.id,
});

Expand Down
2 changes: 1 addition & 1 deletion src/webhooks/handleSubscriptionUpdated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function handleObjectStorageScheduledForCancelation(
): Promise<void> {
logger.info(`Deleting object storage customer ${customer.id} with sub ${subscription.id}`);

await objectStorageService.deleteAccount({
await objectStorageService.suspendAccount({
customerId: customer.id,
});

Expand Down
Loading