Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
Web-CoreX
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hendrik Garske
Web-CoreX
Commits
c57bc574
Commit
c57bc574
authored
Dec 27, 2025
by
Hendrik Garske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Verbleibende any-Typen in customers route korrigiert
parent
629ab9a4
Pipeline
#12
passed with stages
in 2 minutes
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
route.ts
app/api/customers/route.ts
+7
-6
No files found.
app/api/customers/route.ts
View file @
c57bc574
...
@@ -58,21 +58,22 @@ export async function POST(request: NextRequest) {
...
@@ -58,21 +58,22 @@ export async function POST(request: NextRequest) {
})
})
return
NextResponse
.
json
(
customer
,
{
status
:
201
})
return
NextResponse
.
json
(
customer
,
{
status
:
201
})
}
catch
(
dbError
:
any
)
{
}
catch
(
dbError
:
unknown
)
{
console
.
error
(
"Database error creating customer:"
,
dbError
)
console
.
error
(
"Database error creating customer:"
,
dbError
)
const
errorMessage
=
dbError
?.
message
||
"Database error occurred"
const
errorMessage
=
dbError
instanceof
Error
?
dbError
.
message
:
"Database error occurred"
const
errorCode
=
(
dbError
as
{
code
?:
string
})?.
code
return
NextResponse
.
json
(
return
NextResponse
.
json
(
{
{
error
:
errorMessage
,
error
:
errorMessage
,
code
:
dbError
?.
c
ode
,
code
:
errorC
ode
,
details
:
process
.
env
.
NODE_ENV
===
'development'
?
dbError
?
.
stack
:
undefined
details
:
process
.
env
.
NODE_ENV
===
'development'
&&
dbError
instanceof
Error
?
dbError
.
stack
:
undefined
},
},
{
status
:
500
}
{
status
:
500
}
)
)
}
}
}
catch
(
error
:
any
)
{
}
catch
(
error
:
unknown
)
{
console
.
error
(
"Error in POST /api/customers:"
,
error
)
console
.
error
(
"Error in POST /api/customers:"
,
error
)
const
errorMessage
=
error
?.
message
||
error
?.
toString
()
||
"Failed to process request"
const
errorMessage
=
error
instanceof
Error
?
error
.
message
:
String
(
error
)
return
NextResponse
.
json
(
return
NextResponse
.
json
(
{
{
error
:
errorMessage
,
error
:
errorMessage
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment