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
@@ -2,8 +2,7 @@
import { useEffect, useState } from 'react'
import { useAdminI18n } from '@/components/I18nProvider'
const API_BASE = '/api/v1'
import { ADMIN_API_BASE } from '@/lib/api'
interface Renter {
id: string
@@ -75,7 +74,7 @@ export default function AdminRentersPage() {
async function fetchRenters() {
try {
const res = await fetch(`${API_BASE}/admin/renters`, {
const res = await fetch(`${ADMIN_API_BASE}/admin/renters`, {
headers: { Authorization: `Bearer ${getToken()}` },
cache: 'no-store',
})
@@ -103,7 +102,7 @@ export default function AdminRentersPage() {
setActioning(id)
try {
const endpoint = isBlocked ? 'unblock' : 'block'
const res = await fetch(`${API_BASE}/admin/renters/${id}/${endpoint}`, {
const res = await fetch(`${ADMIN_API_BASE}/admin/renters/${id}/${endpoint}`, {
method: 'POST',
headers: { Authorization: `Bearer ${getToken()}` },
})