owner type fix + route handler refactor

This commit is contained in:
2025-05-22 14:42:42 +03:00
parent ca06551382
commit 6963fdb17a
5 changed files with 5 additions and 28 deletions

View File

@@ -13,19 +13,6 @@ export async function POST(req: NextRequest) {
}
const data = await req.json()
const {
transport,
country_from,
city_from,
country_to,
city_to,
cargo_type,
departure,
arrival,
phone_number,
comment,
email_notification,
} = data
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/create_route/`, {
method: 'POST',
@@ -34,18 +21,8 @@ export async function POST(req: NextRequest) {
Authorization: `Bearer ${session.accessToken}`,
},
body: JSON.stringify({
owner_type: data.owner_type,
transport: data.transport,
country_from: data.country_from,
city_from: data.city_from,
country_to: data.country_to,
city_to: data.city_to,
cargo_type: data.cargo_type,
departure: data.departure,
arrival: data.arrival,
phone_number: data.phone_number,
...data,
comment: data.comment || '',
email_notification: data.email_notification,
}),
})