mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-03 14:21:49 +00:00
Enhanced edit tags action so that it calls PATCH endpoint
This commit is contained in:
@@ -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' })
|
||||
|
||||
@@ -59,6 +59,7 @@ export interface ShlinkVisitsParams {
|
||||
|
||||
export interface ShlinkShortUrlMeta extends ShortUrlMeta {
|
||||
longUrl?: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export interface ShlinkDomain {
|
||||
|
||||
Reference in New Issue
Block a user