From 67dcd4e139ff7c5d54dde0315dc3150bca7f07a2 Mon Sep 17 00:00:00 2001 From: Nicholas Orlowsky Date: Wed, 18 Jan 2023 14:18:31 -0600 Subject: [PATCH] working deploys --- .idea/workspace.xml | 26 +++++--------------------- src/components/CreateCruisePage.tsx | 9 ++++++--- src/components/UptimeCard.tsx | 2 +- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index caeaebd..e8fa2d9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,22 +2,9 @@ - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/components/CreateCruisePage.tsx b/src/components/CreateCruisePage.tsx index f29abd2..2e09f4c 100644 --- a/src/components/CreateCruisePage.tsx +++ b/src/components/CreateCruisePage.tsx @@ -2,6 +2,7 @@ import {useState} from "react"; import URI from "urijs"; import {Namespace} from "../nws-api/types"; import {useNWSAccount, useNWSAuthKey} from "../nws-api/hooks"; +import {useSearchParams} from "react-router-dom"; export default function CreateCruisePage() { const [page, setPage] = useState('info'); @@ -16,18 +17,20 @@ export default function CreateCruisePage() { const authKey = useNWSAuthKey(); const acct = useNWSAccount(); + const [search, useSearch] = useSearchParams(); function deploy() { - fetch("https://api-nws.nickorlow.com/Services/" + acct!.id + "/service", + fetch("https://api-nws.nickorlow.com/" + acct!.id + "/service", { method: 'POST', headers: { - "Authorization": authKey + "Authorization": authKey, + "Content-Type": "application/json" }, body: JSON.stringify({ "serviceName": name, "containerUrl": `ghcr.io/${owner}/${repo}`, - "namespaceId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "namespaceId": search.get("namespaceId"), "serviceUrl": hostUriInput, }) }).then((response)=> { diff --git a/src/components/UptimeCard.tsx b/src/components/UptimeCard.tsx index da418a6..704870f 100644 --- a/src/components/UptimeCard.tsx +++ b/src/components/UptimeCard.tsx @@ -8,7 +8,7 @@ export default function UptimeCard(props: {uptime: UptimeRecord, isService: bool const [isModalOpen, setModalOpen] = useState(false); return(
-

setModalOpen(true)}>{props.uptime.name}

+

setModalOpen(true)}>{props.uptime.name}