Update qovery integration

This commit is contained in:
Tuan Dang
2023-09-19 13:50:01 +01:00
parent 0b59a92dfb
commit e3ef826f52
10 changed files with 222 additions and 174 deletions
@@ -52,7 +52,7 @@ const integrationAuthKeys = {
}: {
integrationAuthId: string;
environmentId: string;
scope: "Job" | "Application" | "Container";
scope: "job" | "application" | "container";
}) => [{ integrationAuthId, environmentId, scope }, "integrationAuthQoveryScopes"] as const,
getIntegrationAuthRailwayEnvironments: ({
integrationAuthId,
@@ -206,9 +206,9 @@ const fetchIntegrationAuthQoveryScopes = async ({
}: {
integrationAuthId: string;
environmentId: string;
scope: "Job" | "Application" | "Container";
scope: "job" | "application" | "container";
}) => {
if (scope === "Application") {
if (scope === "application") {
const {
data: { apps }
} = await apiRequest.get<{ apps: App[] }>(
@@ -223,7 +223,7 @@ const fetchIntegrationAuthQoveryScopes = async ({
return apps;
}
if (scope === "Container") {
if (scope === "container") {
const {
data: { containers }
} = await apiRequest.get<{ containers: App[] }>(
@@ -238,7 +238,7 @@ const fetchIntegrationAuthQoveryScopes = async ({
return containers;
}
if (scope === "Job") {
if (scope === "job") {
const {
data: { jobs }
} = await apiRequest.get<{ jobs: App[] }>(
@@ -463,7 +463,7 @@ export const useGetIntegrationAuthQoveryScopes = ({
}: {
integrationAuthId: string;
environmentId: string;
scope: "Job" | "Application" | "Container";
scope: "job" | "application" | "container";
}) => {
return useQuery({
queryKey: integrationAuthKeys.getIntegrationAuthQoveryScopes({
@@ -40,6 +40,7 @@ export const useCreateIntegration = () => {
owner,
path,
region,
scope,
secretPath,
metadata
}: {
@@ -56,16 +57,10 @@ export const useCreateIntegration = () => {
owner?: string;
path?: string;
region?: string;
scope?: string;
metadata?: {
secretPrefix?: string;
secretSuffix?: string;
org?: string;
orgId?: string;
project?: string;
projectId?: string;
environment?: string;
environmentId?: string;
scope?: string;
}
}) => {
const { data: { integration } } = await apiRequest.post("/api/v1/integration", {
@@ -80,6 +75,7 @@ export const useCreateIntegration = () => {
targetServiceId,
owner,
path,
scope,
region,
secretPath,
metadata