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
8abd310c
Commit
8abd310c
authored
Dec 27, 2025
by
Hendrik Garske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Next.js 16 async params in API routes
parent
4f78567b
Pipeline
#4
failed with stages
in 24 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
route.ts
app/api/customers/[id]/route.ts
+9
-6
route.ts
app/api/time-entries/[id]/route.ts
+3
-2
No files found.
app/api/customers/[id]/route.ts
View file @
8abd310c
...
@@ -3,11 +3,12 @@ import { prisma } from "@/lib/prisma"
...
@@ -3,11 +3,12 @@ import { prisma } from "@/lib/prisma"
export
async
function
GET
(
export
async
function
GET
(
request
:
NextRequest
,
request
:
NextRequest
,
{
params
}:
{
params
:
{
id
:
string
}
}
{
params
}:
{
params
:
Promise
<
{
id
:
string
}
>
}
)
{
)
{
try
{
try
{
const
{
id
}
=
await
params
const
customer
=
await
prisma
.
customer
.
findUnique
({
const
customer
=
await
prisma
.
customer
.
findUnique
({
where
:
{
id
:
params
.
id
},
where
:
{
id
},
include
:
{
include
:
{
timeEntries
:
{
timeEntries
:
{
include
:
{
include
:
{
...
@@ -33,9 +34,10 @@ export async function GET(
...
@@ -33,9 +34,10 @@ export async function GET(
export
async
function
PUT
(
export
async
function
PUT
(
request
:
NextRequest
,
request
:
NextRequest
,
{
params
}:
{
params
:
{
id
:
string
}
}
{
params
}:
{
params
:
Promise
<
{
id
:
string
}
>
}
)
{
)
{
try
{
try
{
const
{
id
}
=
await
params
const
body
=
await
request
.
json
()
const
body
=
await
request
.
json
()
const
{
name
,
email
,
phone
,
company
,
address
,
notes
}
=
body
const
{
name
,
email
,
phone
,
company
,
address
,
notes
}
=
body
...
@@ -44,7 +46,7 @@ export async function PUT(
...
@@ -44,7 +46,7 @@ export async function PUT(
}
}
const
customer
=
await
prisma
.
customer
.
update
({
const
customer
=
await
prisma
.
customer
.
update
({
where
:
{
id
:
params
.
id
},
where
:
{
id
},
data
:
{
data
:
{
name
,
name
,
email
:
email
||
null
,
email
:
email
||
null
,
...
@@ -64,11 +66,12 @@ export async function PUT(
...
@@ -64,11 +66,12 @@ export async function PUT(
export
async
function
DELETE
(
export
async
function
DELETE
(
request
:
NextRequest
,
request
:
NextRequest
,
{
params
}:
{
params
:
{
id
:
string
}
}
{
params
}:
{
params
:
Promise
<
{
id
:
string
}
>
}
)
{
)
{
try
{
try
{
const
{
id
}
=
await
params
await
prisma
.
customer
.
delete
({
await
prisma
.
customer
.
delete
({
where
:
{
id
:
params
.
id
},
where
:
{
id
},
})
})
return
NextResponse
.
json
({
success
:
true
})
return
NextResponse
.
json
({
success
:
true
})
...
...
app/api/time-entries/[id]/route.ts
View file @
8abd310c
...
@@ -3,11 +3,12 @@ import { prisma } from "@/lib/prisma"
...
@@ -3,11 +3,12 @@ import { prisma } from "@/lib/prisma"
export
async
function
DELETE
(
export
async
function
DELETE
(
request
:
NextRequest
,
request
:
NextRequest
,
{
params
}:
{
params
:
{
id
:
string
}
}
{
params
}:
{
params
:
Promise
<
{
id
:
string
}
>
}
)
{
)
{
try
{
try
{
const
{
id
}
=
await
params
await
prisma
.
timeEntry
.
delete
({
await
prisma
.
timeEntry
.
delete
({
where
:
{
id
:
params
.
id
},
where
:
{
id
},
})
})
return
NextResponse
.
json
({
success
:
true
})
return
NextResponse
.
json
({
success
:
true
})
...
...
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