Implemented edition of tags

This commit is contained in:
Alejandro Celaya
2018-08-18 22:59:53 +02:00
parent 878e336ba1
commit d541543ab3
10 changed files with 197 additions and 6 deletions

View File

@@ -59,6 +59,11 @@ export class ShlinkApiClient {
.then(() => ({ tags }))
.catch(e => this._handleAuthError(e, this.deleteTag, []));
editTag = (oldName, newName) =>
this._performRequest('/tags', 'PUT', {}, { oldName, newName })
.then(() => ({ oldName, newName }))
.catch(e => this._handleAuthError(e, this.editTag, [oldName, newName]));
_performRequest = async (url, method = 'GET', query = {}, body = {}) => {
if (isEmpty(this._token)) {
this._token = await this._authenticate();