From 46d366a6628503d480ef5f07e82f6816f9de0b02 Mon Sep 17 00:00:00 2001 From: TakahashiNguyen Date: Sun, 19 Apr 2026 08:47:10 +0000 Subject: [PATCH] fix: minor (#35) Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: https://git.demonkernel.io.vn/FoodSurf/frontend/pulls/35 --- .gitea/workflows/release.yaml | 27 +++++++++++++++++++++++---- app/(main)/register/page.tsx | 8 +++++--- next.config.ts | 12 ++++++++++++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index ff05c53..a3f2720 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -22,9 +22,16 @@ jobs: id-token: write runs-on: ubuntu-latest steps: - - uses: gerlero/apt-install@v1 - with: - packages: docker.io zip + - name: Install dependencies with Proxy + env: + http_proxy: "http://host.docker.internal:3142" + https_proxy: "http://host.docker.internal:3142" + run: | + # Kiểm tra proxy có hoạt động không + echo "Acquire::http::Proxy \"$http_proxy\";" > /etc/apt/apt.conf.d/80proxy + apt-get update + apt-get install -y --no-install-recommends --no-install-suggests \ + docker-cli zip - name: Setup SSH Key run: | @@ -43,7 +50,19 @@ jobs: with: version: latest run_install: false - cache: true + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Update dependencies run: pnpm update diff --git a/app/(main)/register/page.tsx b/app/(main)/register/page.tsx index 2325249..26b78bf 100644 --- a/app/(main)/register/page.tsx +++ b/app/(main)/register/page.tsx @@ -6,7 +6,7 @@ import { SHOP_INFO } from "@/lib/constants"; import Image from "next/image"; import Link from "next/link"; import { useRouter } from "next/navigation"; -import { FormEvent, useState } from "react"; +import { SubmitEvent, useState } from "react"; // Static OTP for demo (in production, this would be sent via SMS) const DEMO_OTP = "123456"; @@ -28,7 +28,7 @@ export default function RegisterPage() { return phoneRegex.test(phoneNumber); }; - const handlePhoneSubmit = (e: FormEvent) => { + const handlePhoneSubmit = (e: SubmitEvent) => { e.preventDefault(); if (!phone.trim()) { @@ -44,12 +44,14 @@ export default function RegisterPage() { return; } + + // Move to OTP step setStep("otp"); setErrors({ phone: "", otp: "" }); }; - const handleOtpSubmit = (e: FormEvent) => { + const handleOtpSubmit = (e: SubmitEvent) => { e.preventDefault(); if (!otp.trim()) { diff --git a/next.config.ts b/next.config.ts index 798d55e..0568747 100644 --- a/next.config.ts +++ b/next.config.ts @@ -19,6 +19,18 @@ const nextConfig: NextConfig = { }, ], }, + async rewrites() { + const rewrites = []; + + if (process.env.NODE_ENV !== "production") { + rewrites.push({ + source: "/api/:path*", + destination: "http://host.docker.internal:32080/api/:path*", + }); + } + + return rewrites; + }, }; export default nextConfig;