Created component to edit short URLs meta

This commit is contained in:
Alejandro Celaya
2020-01-17 21:07:59 +01:00
parent 2d60f830f7
commit 80a8e0b55c
10 changed files with 168 additions and 26 deletions

View File

@@ -23,7 +23,7 @@ export default class ShlinkApiClient {
listShortUrls = pipe(
(options = {}) => reject(isNil, options),
(options = {}) => this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls)
(options) => this._performRequest('/short-urls', 'GET', options).then((resp) => resp.data.shortUrls)
);
createShortUrl = (options) => {
@@ -49,6 +49,10 @@ export default class ShlinkApiClient {
this._performRequest(`/short-urls/${shortCode}/tags`, 'PUT', {}, { tags })
.then((resp) => resp.data.tags);
updateShortUrlMeta = (shortCode, meta) =>
this._performRequest(`/short-urls/${shortCode}`, 'PATCH', {}, meta)
.then(() => ({ meta }));
listTags = () =>
this._performRequest('/tags', 'GET')
.then((resp) => resp.data.tags.data);