Просмотр исходного кода

Added api methods for getting the complete onboarding state

jnfrati 4 лет назад
Родитель
Сommit
02101f1c61
1 измененных файлов с 20 добавлено и 0 удалено
  1. 20 0
      dashboard/src/shared/api.tsx

+ 20 - 0
dashboard/src/shared/api.tsx

@@ -1081,6 +1081,24 @@ const saveOnboardingState = baseApi<{}, { project_id: number }>(
   ({ project_id }) => `/api/projects/${project_id}/onboarding`
 );
 
+const getOnboardingInfra = baseApi<
+  {},
+  { project_id: number; registry_infra_id: number }
+>(
+  "GET",
+  ({ project_id, registry_infra_id }) =>
+    `/api/projects/${project_id}/infras/${registry_infra_id}`
+);
+
+const getOnboardingRegistry = baseApi<
+  {},
+  { project_id: number; registry_connection_id: number }
+>(
+  "GET",
+  ({ project_id, registry_connection_id }) =>
+    `/api/projects/${project_id}/registries/${registry_connection_id}`
+);
+
 // Bundle export to allow default api import (api.<method> is more readable)
 export default {
   checkAuth,
@@ -1192,4 +1210,6 @@ export default {
   getHasBilling,
   getOnboardingState,
   saveOnboardingState,
+  getOnboardingInfra,
+  getOnboardingRegistry,
 };