diff options
| author | Haishan <[email protected]> | 2020-06-07 17:09:23 +0800 |
|---|---|---|
| committer | Haishan <[email protected]> | 2020-06-07 17:09:23 +0800 |
| commit | 201f6904c2d822d4d862ba39b8706de726eb7148 (patch) | |
| tree | 5096c89fe014207f48010764c146f337eac9afe5 /src/api | |
| parent | bbb9f55183bbcf9fadb6a746b8bdc15a423793e8 (diff) | |
added: modal prompt to close previous connections when switch proxy
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/connections.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/api/connections.js b/src/api/connections.js index 528b2fc..50bd4fe 100644 --- a/src/api/connections.js +++ b/src/api/connections.js @@ -82,4 +82,15 @@ async function closeAllConnections(apiConfig) { return await fetch(url + endpoint, { ...init, method: 'DELETE' }); } +export async function fetchConns(apiConfig) { + const { url, init } = getURLAndInit(apiConfig); + return await fetch(url + endpoint, { ...init }); +} + +export async function closeConnById(apiConfig, id) { + const { url: baseURL, init } = getURLAndInit(apiConfig); + const url = `${baseURL}${endpoint}/${id}`; + return await fetch(url, { ...init, method: 'DELETE' }); +} + export { fetchData, closeAllConnections }; |
