dispay message in searchcard

This commit is contained in:
2025-05-21 16:31:09 +03:00
parent c4e1e16e79
commit c6c405f232
15 changed files with 712 additions and 148 deletions

View File

@@ -15,24 +15,21 @@ export async function PATCH(req: NextRequest) {
const data = await req.json()
const { firstName, lastName, email, phone_number, country, city } = data
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/account/change_main_data/`,
{
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${session.accessToken}`,
},
body: JSON.stringify({
firstName,
lastName,
email,
phone_number,
country,
city,
}),
}
)
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/change_main_data/`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${session.accessToken}`,
},
body: JSON.stringify({
firstName,
lastName,
email,
phone_number,
country,
city,
}),
})
if (!response.ok) {
const error = await response.json()

View File

@@ -12,16 +12,13 @@ export async function GET(req: NextRequest) {
})
}
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/account/routes/`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${session.accessToken}`,
},
}
)
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/account/routes/`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${session.accessToken}`,
},
})
if (!response.ok) {
const error = await response.json()