Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge 746b7e6 into 05fee55
Browse files Browse the repository at this point in the history
  • Loading branch information
ziccardi committed May 6, 2020
2 parents 05fee55 + 746b7e6 commit dd84ab4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/UnifiedPushAdminClient.ts
Expand Up @@ -90,6 +90,12 @@ export class UnifiedPushAdminClient {
app.variants = undefined;
return this.applicationsAdmin.update(await this.auth(), app);
},

/**
* delete an application
* @param filter filter to be used to find the applications. If not specified, all applications are deleted.
*/
delete: async (filter?: PushApplicationSearchOptions) => this.applicationsAdmin.delete(await this.auth(), filter),
};

readonly variants = {
Expand Down
2 changes: 1 addition & 1 deletion src/applications/ApplicationsAdmin.ts
Expand Up @@ -61,7 +61,7 @@ export class ApplicationsAdmin {
await api.put(`/applications/${pushApplication.pushApplicationID}`, pushApplication);
}
//new delete function
async delete(api: AxiosInstance, filter: PushApplicationSearchOptions) {
async delete(api: AxiosInstance, filter?: PushApplicationSearchOptions) {
return Promise.all(
(await this.find(api, filter)).map(application =>
api.delete(`/applications/${application.pushApplicationID}`).then(() => application)
Expand Down

0 comments on commit dd84ab4

Please sign in to comment.