Enhanced edit tags action so that it calls PATCH endpoint

This commit is contained in:
Alejandro Celaya
2021-02-27 09:49:56 +01:00
parent f653739d50
commit d0825089d0
7 changed files with 56 additions and 15 deletions

View File

@@ -63,6 +63,7 @@ export default class ShlinkApiClient {
this.performRequest(`/short-urls/${shortCode}`, 'DELETE', { domain })
.then(() => {});
/* @deprecated. If using Shlink 2.6.0 or greater, use updateShortUrlMeta instead */
public readonly updateShortUrlTags = async (
shortCode: string,
domain: OptionalString,
@@ -75,9 +76,9 @@ export default class ShlinkApiClient {
shortCode: string,
domain: OptionalString,
meta: ShlinkShortUrlMeta,
): Promise<ShlinkShortUrlMeta> =>
this.performRequest(`/short-urls/${shortCode}`, 'PATCH', { domain }, meta)
.then(() => meta);
): Promise<ShortUrl> =>
this.performRequest<ShortUrl>(`/short-urls/${shortCode}`, 'PATCH', { domain }, meta)
.then(({ data }) => data);
public readonly listTags = async (): Promise<ShlinkTags> =>
this.performRequest<{ tags: ShlinkTagsResponse }>('/tags', 'GET', { withStats: 'true' })

View File

@@ -59,6 +59,7 @@ export interface ShlinkVisitsParams {
export interface ShlinkShortUrlMeta extends ShortUrlMeta {
longUrl?: string;
tags?: string[];
}
export interface ShlinkDomain {