Skip to content

Commit 484753e

Browse files
committed
Removing service paths
1 parent a117943 commit 484753e

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

src/Common/API/CoreAPI.ts

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { API_STATUS_CODES, FALLBACK_REQUEST_TIMEOUT, Host, SERVICE_PATHS } from '@Common/Constants'
17+
import { API_STATUS_CODES, FALLBACK_REQUEST_TIMEOUT, Host } from '@Common/Constants'
1818
import { noop } from '@Common/Helper'
1919
import { ServerErrors } from '@Common/ServerError'
2020
import { APIOptions, ResponseType } from '@Common/Types'
@@ -69,7 +69,7 @@ class CoreAPI {
6969
} else {
7070
currentUrl = `${this.host}/${url}`
7171
}
72-
72+
7373
return fetch(
7474
currentUrl,
7575
!isMultipartRequest
@@ -281,19 +281,32 @@ class CoreAPI {
281281
options?: APIOptions,
282282
isMultipartRequest?: boolean,
283283
isProxyHost?: boolean,
284-
): Promise<ResponseType<T>> => this.fetchInTime<K>({ url, type: 'POST', data, options, isMultipartRequest, isProxyHost })
284+
): Promise<ResponseType<T>> =>
285+
this.fetchInTime<K>({ url, type: 'POST', data, options, isMultipartRequest, isProxyHost })
285286

286-
put = <T = any, K = object>(url: string, data: K, options?: APIOptions, isProxyHost?: boolean): Promise<ResponseType<T>> =>
287-
this.fetchInTime<K>({ url, type: 'PUT', data, options, isProxyHost })
287+
put = <T = any, K = object>(
288+
url: string,
289+
data: K,
290+
options?: APIOptions,
291+
isProxyHost?: boolean,
292+
): Promise<ResponseType<T>> => this.fetchInTime<K>({ url, type: 'PUT', data, options, isProxyHost })
288293

289-
patch = <T = any, K = object>(url: string, data: K, options?: APIOptions, isProxyHost?: boolean): Promise<ResponseType<T>> =>
290-
this.fetchInTime<K>({ url, type: 'PATCH', data, options, isProxyHost })
294+
patch = <T = any, K = object>(
295+
url: string,
296+
data: K,
297+
options?: APIOptions,
298+
isProxyHost?: boolean,
299+
): Promise<ResponseType<T>> => this.fetchInTime<K>({ url, type: 'PATCH', data, options, isProxyHost })
291300

292301
get = <T = any>(url: string, options?: APIOptions, isProxyHost?: boolean): Promise<ResponseType<T>> =>
293302
this.fetchInTime({ url, type: 'GET', data: null, options, isProxyHost })
294303

295-
trash = <T = any, K = object>(url: string, data?: K, options?: APIOptions, isProxyHost?: boolean): Promise<ResponseType<T>> =>
296-
this.fetchInTime<K>({ url, type: 'DELETE', data, options, isProxyHost })
304+
trash = <T = any, K = object>(
305+
url: string,
306+
data?: K,
307+
options?: APIOptions,
308+
isProxyHost?: boolean,
309+
): Promise<ResponseType<T>> => this.fetchInTime<K>({ url, type: 'DELETE', data, options, isProxyHost })
297310

298311
setGlobalAPITimeout = (timeout: number) => {
299312
this.timeout = timeout || FALLBACK_REQUEST_TIMEOUT

src/Common/Constants.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ import { BackupAndScheduleListViewEnum, BackupLocationsTypes } from '@PagesDevtr
2121
export const FALLBACK_REQUEST_TIMEOUT = 60000
2222
export const Host = window?.__ORCHESTRATOR_ROOT__ ?? '/orchestrator'
2323

24-
// Service path constants for API routing
25-
export const SERVICE_PATHS = {
26-
ATHENA: 'athena',
27-
ORCHESTRATOR: 'orchestrator',
28-
// Add other service paths as needed in the future
29-
} as const
30-
3124
export const DOCUMENTATION_HOME_PAGE = 'https://docs.devtron.ai'
3225
export const DEVTRON_HOME_PAGE = 'https://devtron.ai/'
3326
export const DOCUMENTATION_VERSION = '/devtron/v1.7'

0 commit comments

Comments
 (0)