backend routes
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user