fix admin pages

This commit is contained in:
root
2026-05-17 17:37:13 -04:00
parent 0b73504455
commit 5ea1780134
12 changed files with 42 additions and 53 deletions
@@ -11,8 +11,7 @@ import {
type MarketplaceLanguage,
} from '@rentaldrivego/types'
import { useAdminI18n } from '@/components/I18nProvider'
const API_BASE = '/api/v1'
import { ADMIN_API_BASE } from '@/lib/api'
interface Company {
id: string
@@ -187,11 +186,11 @@ export default function AdminSiteConfigPage() {
const token = localStorage.getItem('admin_token')
try {
const [companiesRes, homepageRes] = await Promise.all([
fetch(`${API_BASE}/admin/companies`, {
fetch(`${ADMIN_API_BASE}/admin/companies`, {
headers: token ? { Authorization: `Bearer ${token}` } : {},
cache: 'no-store',
}),
fetch(`${API_BASE}/admin/site-config/marketplace-homepage`, {
fetch(`${ADMIN_API_BASE}/admin/site-config/marketplace-homepage`, {
headers: token ? { Authorization: `Bearer ${token}` } : {},
cache: 'no-store',
}),
@@ -280,7 +279,7 @@ export default function AdminSiteConfigPage() {
const token = localStorage.getItem('admin_token')
try {
const res = await fetch(`${API_BASE}/admin/site-config/marketplace-homepage`, {
const res = await fetch(`${ADMIN_API_BASE}/admin/site-config/marketplace-homepage`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',