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
c2f2c5ce
Commit
c2f2c5ce
authored
Dec 27, 2025
by
Hendrik Garske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: TypeScript-Fehler in API-Routen behoben (Typ-Definitionen erweitert)
parent
160edf33
Pipeline
#21
failed with stages
in 25 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
route.ts
app/api/customers/[id]/route.ts
+12
-1
route.ts
app/api/time-entries/route.ts
+13
-1
No files found.
app/api/customers/[id]/route.ts
View file @
c2f2c5ce
...
@@ -34,7 +34,18 @@ export async function GET(
...
@@ -34,7 +34,18 @@ export async function GET(
[
id
]
[
id
]
)
)
const
timeEntries
=
timeEntriesResult
.
rows
.
map
((
row
:
{
user
:
unknown
})
=>
({
const
timeEntries
=
timeEntriesResult
.
rows
.
map
((
row
:
{
id
:
string
description
:
string
startTime
:
Date
endTime
:
Date
duration
:
number
createdAt
:
Date
updatedAt
:
Date
customerId
:
string
userId
:
string
user
:
unknown
})
=>
({
id
:
row
.
id
,
id
:
row
.
id
,
description
:
row
.
description
,
description
:
row
.
description
,
startTime
:
row
.
startTime
,
startTime
:
row
.
startTime
,
...
...
app/api/time-entries/route.ts
View file @
c2f2c5ce
...
@@ -48,7 +48,19 @@ export async function GET(request: NextRequest) {
...
@@ -48,7 +48,19 @@ export async function GET(request: NextRequest) {
params
.
length
>
0
?
params
:
undefined
params
.
length
>
0
?
params
:
undefined
)
)
const
timeEntries
=
result
.
rows
.
map
((
row
:
{
customer
:
unknown
;
user
:
unknown
})
=>
({
const
timeEntries
=
result
.
rows
.
map
((
row
:
{
id
:
string
description
:
string
startTime
:
Date
endTime
:
Date
duration
:
number
createdAt
:
Date
updatedAt
:
Date
customerId
:
string
userId
:
string
customer
:
unknown
user
:
unknown
})
=>
({
...
rowToTimeEntry
(
row
),
...
rowToTimeEntry
(
row
),
customer
:
typeof
row
.
customer
===
'string'
?
JSON
.
parse
(
row
.
customer
)
:
row
.
customer
,
customer
:
typeof
row
.
customer
===
'string'
?
JSON
.
parse
(
row
.
customer
)
:
row
.
customer
,
user
:
typeof
row
.
user
===
'string'
?
JSON
.
parse
(
row
.
user
)
:
row
.
user
,
user
:
typeof
row
.
user
===
'string'
?
JSON
.
parse
(
row
.
user
)
:
row
.
user
,
...
...
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