feat(api-client-final): API-Client mit allen Phase-3 Endpoints + Logout-fix [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 05:00:29 +02:00
parent 93eeba9134
commit dac8bfafda
3 changed files with 53 additions and 4 deletions

View File

@ -5,6 +5,9 @@
"empty-loading-states",
"time-entries-search-filter"
],
"current_feature": "user-profile-page",
"started_at": "2026-05-23T04:57:10.921624"
"current_feature": "api-client-final",
"started_at": "2026-05-23T04:57:10.921624",
"attempted_features": [
"user-profile-page"
]
}

View File

@ -413,3 +413,20 @@ src/routes/users.ts(41,34): error TS2339: Property 'id' does not exist on type '
undefined
/home/dark/Developer/EmberClone/apps/api:
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command failed with exit code 2: tsc --noEmit -p tsconfig.json
- `04:59:58` **INFO** Committed feature user-profile-page
- `04:59:59` **INFO** Pushed: rc=0
## Phase-3 Feature: api-client-final (2026-05-23 04:59:59)
- `04:59:59` **INFO** Description: API-Client mit allen Phase-3 Endpoints + Logout-fix
- `04:59:59` **INFO** Generating apps/web/src/lib/api.ts (FINALE Version der api.ts. Behalte ALLE bestehenden Funktionen (login,…)
- `05:00:27` **INFO** wrote 3285 chars in 28.9s (attempt 1)
- `05:00:27` **INFO** Running tsc --noEmit on api…
- `05:00:29` **WARN** tsc errors:
src/routes/users.ts(21,34): error TS2339: Property 'id' does not exist on type 'string | object | Buffer<ArrayBufferLike>'.
Property 'id' does not exist on type 'string'.
src/routes/users.ts(41,34): error TS2339: Property 'id' does not exist on type 'string | object | Buffer<ArrayBufferLike>'.
Property 'id' does not exist on type 'string'.
undefined
/home/dark/Developer/EmberClone/apps/api:
ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command failed with exit code 2: tsc --noEmit -p tsconfig.json

View File

@ -40,7 +40,7 @@ export const api = {
return data
},
logout() {
async logout() {
localStorage.removeItem("auth_token")
return request("/auth/logout", { method: "POST" }).catch(() => {})
},
@ -49,6 +49,13 @@ export const api = {
return request<{ id: string; email: string; name: string; role: "admin" | "user" }>("/auth/me")
},
async updateProfile(data: { name: string }) {
return request("/users/me", {
method: "PATCH",
body: JSON.stringify(data)
})
},
async listTimeEntries(opts?: Record<string, string>) {
const query = opts ? `?${new URLSearchParams(opts).toString()}` : ""
return request<any[]>(`/time-entries${query}`)
@ -67,8 +74,30 @@ export const api = {
})
},
async getRunningTimeEntry() {
try {
return await request<any>("/time-entries/running")
} catch (err: any) {
if (err.status === 404) return null
throw err
}
},
async startTimeEntry(data: { description: string; projectId?: string }) {
return request("/time-entries/start", {
method: "POST",
body: JSON.stringify(data)
})
},
async stopTimeEntry(id: string) {
return request(`/time-entries/${id}/stop`, {
method: "POST"
})
},
async listCustomers() {
return request<any[]>( "/customers")
return request<any[]>("/customers")
},
async createCustomer(data: Partial<CustomerInsert>) {