mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-05-22 12:26:18 +03:00
17 lines
514 B
TypeScript
17 lines
514 B
TypeScript
import { IBaseApiResponse } from '../types';
|
|
import { createBaseApiRequest } from './createBaseApiRequest';
|
|
import { getClashApiUrl } from '../../helpers';
|
|
|
|
export async function triggerProxySelector(
|
|
selector: string,
|
|
outbound: string,
|
|
): Promise<IBaseApiResponse<void>> {
|
|
return createBaseApiRequest<void>(() =>
|
|
fetch(`${getClashApiUrl()}/proxies/${selector}`, {
|
|
method: 'PUT',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ name: outbound }),
|
|
}),
|
|
);
|
|
}
|