Skip to content

Commit

Permalink
feat: add DeleteSubscription endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Cysword committed Apr 10, 2024
1 parent 8bbb51d commit 8f0f07f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`module exports > exposes the correct data from index.ts 1`] = `
"BASE_URL": "https://api.myparcel.nl",
"DeleteAccountMessage": [Function],
"DeleteCarrierOptions": [Function],
"DeleteSubscription": [Function],
"DeleteWebhookSubscriptions": [Function],
"FetchClient": [Function],
"GetAccount": [Function],
Expand Down
17 changes: 17 additions & 0 deletions src/endpoints/private/subscriptions/DeleteSubscription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {type HttpMethod} from '@/types';
import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint';
import {type CreateDefinition} from '@/model/endpoint/AbstractEndpoint.types';

type DeleteSubscriptionDefinition = CreateDefinition<{
name: typeof DeleteSubscription.name;
path: {
id: number;
};
}>;

export class DeleteSubscription extends AbstractPrivateEndpoint<DeleteSubscriptionDefinition> {
public readonly method: HttpMethod = 'DELETE';
public readonly name = 'deleteSubscription';
public readonly path = 'subscriptions/:id';
public readonly property = 'subscriptions';
}
1 change: 1 addition & 0 deletions src/endpoints/private/subscriptions/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './DeleteSubscription';
export * from './GetSubscriptions';
export * from './PatchSubscriptions';
export * from './PostSubscriptions';
Expand Down

0 comments on commit 8f0f07f

Please sign in to comment.