Implemented short URLs deletion

This commit is contained in:
Alejandro Celaya
2018-09-16 10:47:17 +02:00
parent 2d6dda3576
commit f2d03203ae
8 changed files with 150 additions and 11 deletions

View File

@@ -44,6 +44,11 @@ export class ShlinkApiClient {
.then((resp) => resp.data)
.catch((e) => this._handleAuthError(e, this.getShortUrl, [ shortCode ]));
deleteShortUrl = (shortCode) =>
this._performRequest(`/short-codes/${shortCode}`, 'DELETE')
.then(() => ({}))
.catch((e) => this._handleAuthError(e, this.deleteShortUrl, [ shortCode ]));
updateShortUrlTags = (shortCode, tags) =>
this._performRequest(`/short-codes/${shortCode}/tags`, 'PUT', {}, { tags })
.then((resp) => resp.data.tags)