feat(api-client-extensions): Erweitere lib/api.ts um Customer + Project Endpoints + Logou [tsc:fail]
This commit is contained in:
parent
4610ff24b8
commit
1b0260dc91
@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"completed_features": [],
|
"completed_features": [],
|
||||||
"current_feature": "projects-crud",
|
"current_feature": "api-client-extensions",
|
||||||
"started_at": "2026-05-23T04:42:59.289476",
|
"started_at": "2026-05-23T04:42:59.289476",
|
||||||
"attempted_features": [
|
"attempted_features": [
|
||||||
"customers-crud"
|
"customers-crud",
|
||||||
|
"projects-crud"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -226,3 +226,31 @@ src/routes/customers.ts(14,49): error TS7006: Parameter 'reply' implicitly has a
|
|||||||
src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'.
|
src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'.
|
||||||
src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
src/routes/customers.ts(22,36): error TS7006: Parameter
|
src/routes/customers.ts(22,36): error TS7006: Parameter
|
||||||
|
- `04:45:09` **INFO** Committed feature projects-crud
|
||||||
|
- `04:45:09` **INFO** Pushed: rc=0
|
||||||
|
- `04:45:09` **WARN** ⚠️ Feature projects-crud partial — moving on
|
||||||
|
|
||||||
|
## Feature: api-client-extensions (2026-05-23 04:45:09)
|
||||||
|
|
||||||
|
- `04:45:09` **INFO** Description: Erweitere lib/api.ts um Customer + Project Endpoints + Logout fixes
|
||||||
|
- `04:45:09` **INFO** Files: 1
|
||||||
|
- `04:45:09` **INFO** Generating apps/web/src/lib/api.ts (ERWEITERTE Version der bestehenden api.ts. Behalte alle bestehenden Fu…)
|
||||||
|
- `04:45:32` **INFO** wrote 2628 chars in 22.8s (attempt 1)
|
||||||
|
- `04:45:32` **INFO** Running tsc --noEmit on api…
|
||||||
|
- `04:45:33` **WARN** tsc errors:
|
||||||
|
src/routes/auth.ts(9,11): error TS2339: Property 'post' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/auth.ts(9,33): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
|
src/routes/auth.ts(9,42): error TS7006: Parameter 'reply' implicitly has an 'any' type.
|
||||||
|
src/routes/auth.ts(22,27): error TS2339: Property 'jwt' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/auth.ts(44,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/auth.ts(44,29): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
|
src/routes/auth.ts(44,38): error TS7006: Parameter 'reply' implicitly has an 'any' type.
|
||||||
|
src/routes/auth.ts(70,11): error TS2339: Property 'post' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/auth.ts(70,34): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
|
src/routes/auth.ts(70,43): error TS7006: Parameter 'reply' implicitly has an 'any' type.
|
||||||
|
src/routes/customers.ts(14,11): error TS2339: Property 'addHook' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/customers.ts(14,40): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
|
src/routes/customers.ts(14,49): error TS7006: Parameter 'reply' implicitly has an 'any' type.
|
||||||
|
src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'.
|
||||||
|
src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type.
|
||||||
|
src/routes/customers.ts(22,36): error TS7006: Parameter
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { TimeEntryInsert } from "@emberclone/shared"
|
import type { TimeEntryInsert, CustomerInsert, ProjectInsert } from "@emberclone/shared"
|
||||||
|
|
||||||
const API_BASE = "/api"
|
const API_BASE = "/api"
|
||||||
|
|
||||||
@ -65,5 +65,40 @@ export const api = {
|
|||||||
return request(`/time-entries/${id}`, {
|
return request(`/time-entries/${id}`, {
|
||||||
method: "DELETE"
|
method: "DELETE"
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async listCustomers() {
|
||||||
|
return request<any[]>( "/customers")
|
||||||
|
},
|
||||||
|
|
||||||
|
async createCustomer(data: Partial<CustomerInsert>) {
|
||||||
|
return request("/customers", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async deleteCustomer(id: string) {
|
||||||
|
return request(`/customers/${id}`, {
|
||||||
|
method: "DELETE"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async listProjects(opts?: Record<string, string>) {
|
||||||
|
const query = opts ? `?${new URLSearchParams(opts).toString()}` : ""
|
||||||
|
return request<any[]>(`/projects${query}`)
|
||||||
|
},
|
||||||
|
|
||||||
|
async createProject(data: Partial<ProjectInsert>) {
|
||||||
|
return request("/projects", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async deleteProject(id: string) {
|
||||||
|
return request(`/projects/${id}`, {
|
||||||
|
method: "DELETE"
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user