From 4250cc42db80f3beea2471091260b37da9337b0f Mon Sep 17 00:00:00 2001 From: log101 Date: Mon, 29 Jul 2024 21:54:00 +0300 Subject: [PATCH] fix: type in deploy script --- .gitea/workflows/static-deploy.yml | 2 +- src/scripts/index.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/static-deploy.yml b/.gitea/workflows/static-deploy.yml index f3d3efd..5e38cf8 100644 --- a/.gitea/workflows/static-deploy.yml +++ b/.gitea/workflows/static-deploy.yml @@ -53,7 +53,7 @@ jobs: - name: Make envfile uses: SpicyPizza/create-envfile@v2.0 with: - envkey_PUBLIC_BACKEND_HOST: ${{ vars.PUBLIC_BACKEND_URL }} + envkey_PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }} - name: Build with Astro run: | ${{ steps.detect-package-manager.outputs.runner }} astro build diff --git a/src/scripts/index.ts b/src/scripts/index.ts index 486162b..54eec48 100644 --- a/src/scripts/index.ts +++ b/src/scripts/index.ts @@ -44,10 +44,13 @@ const handleSubmit = async (e: SubmitEvent) => { const formData = new FormData(e.target as HTMLFormElement) - const res = await fetch(`https://konulukonum.log101.dev/api/location`, { - method: "POST", - body: formData, - }) + const res = await fetch( + `${import.meta.env.PUBLIC_BACKEND_URL}/api/location`, + { + method: "POST", + body: formData, + } + ) if (res.status === 200) { const data = await res.json()