Skip to content

Commit

Permalink
Add (currently unused) get*Path functions for install & delete routes
Browse files Browse the repository at this point in the history
from #2
  • Loading branch information
John Schulz committed Jul 16, 2019
1 parent 7c0a56b commit b12e6bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x-pack/legacy/plugins/integrations_manager/common/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ export function getListPath() {
export function getInfoPath(pkgkey: string) {
return API_INFO_PATTERN.replace('{pkgkey}', pkgkey);
}

export function getInstallPath(pkgkey: string, asset: string = '') {
return API_INSTALL_PATTERN.replace('{pkgkey}', pkgkey)
.replace('{asset?}', asset)
.replace(/\/$/, ''); // trim trailing slash
}

export function getRemovePath(pkgkey: string, asset: string = '') {
return API_DELETE_PATTERN.replace('{pkgkey}', pkgkey)
.replace('{asset?}', asset)
.replace(/\/$/, ''); // trim trailing slash
}

0 comments on commit b12e6bf

Please sign in to comment.