mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-11 09:06:20 +00:00
Migrated ImageDownloader from axios to fetch
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { hasServerData, ServerWithId } from '../../servers/data';
|
||||
import { GetState } from '../../container/types';
|
||||
import { ShlinkApiClient } from './ShlinkApiClient';
|
||||
import { Fetch } from '../../utils/types';
|
||||
import { JsonFetch } from '../../utils/types';
|
||||
|
||||
const apiClients: Record<string, ShlinkApiClient> = {};
|
||||
|
||||
@@ -16,7 +16,7 @@ const getSelectedServerFromState = (getState: GetState): ServerWithId => {
|
||||
return selectedServer;
|
||||
};
|
||||
|
||||
export const buildShlinkApiClient = (fetch: Fetch) => (getStateOrSelectedServer: GetState | ServerWithId) => {
|
||||
export const buildShlinkApiClient = (fetch: JsonFetch) => (getStateOrSelectedServer: GetState | ServerWithId) => {
|
||||
const { url, apiKey } = isGetState(getStateOrSelectedServer)
|
||||
? getSelectedServerFromState(getStateOrSelectedServer)
|
||||
: getStateOrSelectedServer;
|
||||
|
||||
Reference in New Issue
Block a user