fix(frontend): usage of runtime config in HomePage
This commit is contained in:
parent
4577310c75
commit
e1bbd94224
1 changed files with 3 additions and 1 deletions
|
|
@ -12,19 +12,21 @@ import Link from "next/link"
|
||||||
import { motion } from "framer-motion"
|
import { motion } from "framer-motion"
|
||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
import { useTranslation } from "@/lib/i18n"
|
import { useTranslation } from "@/lib/i18n"
|
||||||
|
import { useConfig } from "@/contexts/ConfigContext"
|
||||||
|
|
||||||
import { useState, useEffect } from "react"
|
import { useState, useEffect } from "react"
|
||||||
import type { Job } from "@/lib/types"
|
import type { Job } from "@/lib/types"
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const config = useConfig()
|
||||||
const [featuredJobs, setFeaturedJobs] = useState<Job[]>([])
|
const [featuredJobs, setFeaturedJobs] = useState<Job[]>([])
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchFeaturedJobs() {
|
async function fetchFeaturedJobs() {
|
||||||
try {
|
try {
|
||||||
const apiBase = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8521"
|
const apiBase = config.apiUrl
|
||||||
console.log("[DEBUG] API Base URL:", apiBase)
|
console.log("[DEBUG] API Base URL:", apiBase)
|
||||||
|
|
||||||
const mapJobs = (jobs: any[]): Job[] =>
|
const mapJobs = (jobs: any[]): Job[] =>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue