Переглянути джерело

Added api methods for getting the complete onboarding state

jnfrati 4 роки тому
батько
коміт
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`
   ({ 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)
 // Bundle export to allow default api import (api.<method> is more readable)
 export default {
 export default {
   checkAuth,
   checkAuth,
@@ -1192,4 +1210,6 @@ export default {
   getHasBilling,
   getHasBilling,
   getOnboardingState,
   getOnboardingState,
   saveOnboardingState,
   saveOnboardingState,
+  getOnboardingInfra,
+  getOnboardingRegistry,
 };
 };