backend routes

This commit is contained in:
2025-05-29 12:35:24 +03:00
parent 6987560a37
commit 327acdd062
10 changed files with 119 additions and 10 deletions

View File

@@ -26,6 +26,8 @@ export default function UserRoutes() {
}
const data = await response.json()
console.log(data)
setRoutes(data || [])
} catch (error) {
console.error('Error fetching routes:', error)

View File

@@ -14,7 +14,7 @@ export async function PATCH(req: NextRequest) {
const { route_id } = await req.json()
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/route_highlight/`, {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/highlight/`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',

View File

@@ -14,7 +14,7 @@ export async function PATCH(req: NextRequest) {
const { route_id } = await req.json()
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/route_up/`, {
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/upper/`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
@@ -31,7 +31,7 @@ export async function PATCH(req: NextRequest) {
const result = await response.json()
return new Response(JSON.stringify(result), { status: 200 })
} catch (error) {
console.error('PATCH /api/account/route_up error:', error)
console.error('PATCH /api/account/upper error:', error)
return new Response(JSON.stringify({ error: 'Internal Server Error' }), {
status: 500,
})