claude-fix: FastifyInstance type, routes/index mount, lucide upgrade, projects where-filter
This commit is contained in:
parent
8f2320a104
commit
8a8a873286
@ -7,6 +7,7 @@
|
|||||||
"projects-crud",
|
"projects-crud",
|
||||||
"api-client-extensions",
|
"api-client-extensions",
|
||||||
"router-with-new-pages",
|
"router-with-new-pages",
|
||||||
"dashboard-stats"
|
"dashboard-stats",
|
||||||
|
"active-timer-widget"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -342,3 +342,10 @@ 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:48:33` **INFO** Committed feature active-timer-widget
|
||||||
|
- `04:48:33` **INFO** Pushed: rc=0
|
||||||
|
- `04:48:33` **WARN** ⚠️ Feature active-timer-widget partial — moving on
|
||||||
|
|
||||||
|
## Phase-2 Run beendet (2026-05-23 04:48:33)
|
||||||
|
|
||||||
|
- `04:48:33` **INFO** OK: 0, Attempted: 6, Total: 6
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { FastifyPluginAsync } from "fastify"
|
import { FastifyInstance } from "fastify"
|
||||||
import argon2 from "argon2"
|
import argon2 from "argon2"
|
||||||
import { db } from "../db"
|
import { db } from "../db"
|
||||||
import { users } from "../db/schema"
|
import { users } from "../db/schema"
|
||||||
import { eq } from "drizzle-orm"
|
import { eq } from "drizzle-orm"
|
||||||
import { LoginRequestSchema } from "@emberclone/shared"
|
import { LoginRequestSchema } from "@emberclone/shared"
|
||||||
|
|
||||||
export default async function authRoutes(fastify: FastifyPluginAsync) {
|
export default async function authRoutes(fastify: FastifyInstance) {
|
||||||
fastify.post("/login", async (request, reply) => {
|
fastify.post("/login", async (request, reply) => {
|
||||||
const body = LoginRequestSchema.parse(request.body)
|
const body = LoginRequestSchema.parse(request.body)
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { FastifyPluginAsync } from "fastify"
|
import { FastifyInstance } from "fastify"
|
||||||
import { db } from "../db"
|
import { db } from "../db"
|
||||||
import { customers } from "../db/schema"
|
import { customers } from "../db/schema"
|
||||||
import { eq, and } from "drizzle-orm"
|
import { eq, and } from "drizzle-orm"
|
||||||
@ -10,7 +10,7 @@ const CustomerSchema = z.object({
|
|||||||
|
|
||||||
const CustomerUpdateSchema = CustomerSchema.partial()
|
const CustomerUpdateSchema = CustomerSchema.partial()
|
||||||
|
|
||||||
export default async function customerRoutes(fastify: FastifyPluginAsync) {
|
export default async function customerRoutes(fastify: FastifyInstance) {
|
||||||
fastify.addHook("preHandler", async (request, reply) => {
|
fastify.addHook("preHandler", async (request, reply) => {
|
||||||
try {
|
try {
|
||||||
await request.jwtVerify()
|
await request.jwtVerify()
|
||||||
|
|||||||
@ -1,13 +1,12 @@
|
|||||||
import { FastifyInstance } from "fastify"
|
import { FastifyInstance } from "fastify"
|
||||||
import authRoutes from "./auth"
|
import authRoutes from "./auth"
|
||||||
|
import customerRoutes from "./customers"
|
||||||
|
import projectRoutes from "./projects"
|
||||||
import timeEntryRoutes from "./time-entries"
|
import timeEntryRoutes from "./time-entries"
|
||||||
|
|
||||||
export async function setupRoutes(server: FastifyInstance) {
|
export async function setupRoutes(server: FastifyInstance) {
|
||||||
server.register(authRoutes, {
|
server.register(authRoutes, { prefix: "/api/auth" })
|
||||||
prefix: "/api/auth"
|
server.register(timeEntryRoutes, { prefix: "/api/time-entries" })
|
||||||
})
|
server.register(customerRoutes, { prefix: "/api/customers" })
|
||||||
|
server.register(projectRoutes, { prefix: "/api/projects" })
|
||||||
server.register(timeEntryRoutes, {
|
}
|
||||||
prefix: "/api/time-entries"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { FastifyPluginAsync } from "fastify"
|
import { FastifyInstance } from "fastify"
|
||||||
import { db } from "../db"
|
import { db } from "../db"
|
||||||
import { projects } from "../db/schema"
|
import { projects } from "../db/schema"
|
||||||
import { eq } from "drizzle-orm"
|
import { eq } from "drizzle-orm"
|
||||||
@ -11,7 +11,7 @@ const ProjectSchema = z.object({
|
|||||||
|
|
||||||
const ProjectUpdateSchema = ProjectSchema.partial()
|
const ProjectUpdateSchema = ProjectSchema.partial()
|
||||||
|
|
||||||
export default async function projectRoutes(fastify: FastifyPluginAsync) {
|
export default async function projectRoutes(fastify: FastifyInstance) {
|
||||||
fastify.addHook("preHandler", async (request, reply) => {
|
fastify.addHook("preHandler", async (request, reply) => {
|
||||||
try {
|
try {
|
||||||
await request.jwtVerify()
|
await request.jwtVerify()
|
||||||
@ -24,18 +24,14 @@ export default async function projectRoutes(fastify: FastifyPluginAsync) {
|
|||||||
const { onlyActive, customerId } = request.query as { onlyActive?: string, customerId?: string }
|
const { onlyActive, customerId } = request.query as { onlyActive?: string, customerId?: string }
|
||||||
const isActiveDefault = onlyActive !== "false"
|
const isActiveDefault = onlyActive !== "false"
|
||||||
|
|
||||||
const filters = []
|
const conds = []
|
||||||
if (isActiveDefault) {
|
if (isActiveDefault) conds.push(eq(projects.active, true))
|
||||||
filters.push(eq(projects.active, true))
|
if (customerId) conds.push(eq(projects.customerId, customerId))
|
||||||
}
|
|
||||||
if (customerId) {
|
|
||||||
filters.push(eq(projects.customerId, customerId))
|
|
||||||
}
|
|
||||||
|
|
||||||
const results = await db
|
const results = await db
|
||||||
.select()
|
.select()
|
||||||
.from(projects)
|
.from(projects)
|
||||||
.where(filters.length > 0 ? and(...filters) : undefined)
|
.where(conds.length ? and(...conds) : undefined as any)
|
||||||
.orderBy(projects.name)
|
.orderBy(projects.name)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { FastifyPluginAsync } from "fastify"
|
import { FastifyInstance } from "fastify"
|
||||||
import { db } from "../db"
|
import { db } from "../db"
|
||||||
import { timeEntries } from "../db/schema"
|
import { timeEntries } from "../db/schema"
|
||||||
import { eq, and, gte, lte, isNull } from "drizzle-orm"
|
import { eq, and, gte, lte, isNull } from "drizzle-orm"
|
||||||
@ -18,7 +18,7 @@ const StartEntrySchema = z.object({
|
|||||||
description: z.string().min(1)
|
description: z.string().min(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
export default async function timeEntryRoutes(fastify: FastifyPluginAsync) {
|
export default async function timeEntryRoutes(fastify: FastifyInstance) {
|
||||||
fastify.addHook("preHandler", async (request, reply) => {
|
fastify.addHook("preHandler", async (request, reply) => {
|
||||||
try {
|
try {
|
||||||
await request.jwtVerify()
|
await request.jwtVerify()
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
"@emberclone/shared": "workspace:*",
|
"@emberclone/shared": "workspace:*",
|
||||||
"@tanstack/react-query": "^5.59.0",
|
"@tanstack/react-query": "^5.59.0",
|
||||||
"@tanstack/react-router": "^1.62.7",
|
"@tanstack/react-router": "^1.62.7",
|
||||||
|
"lucide-react": "^1.16.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
},
|
},
|
||||||
|
|||||||
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@ -72,6 +72,9 @@ importers:
|
|||||||
'@tanstack/react-router':
|
'@tanstack/react-router':
|
||||||
specifier: ^1.62.7
|
specifier: ^1.62.7
|
||||||
version: 1.170.7(react-dom@18.3.1)(react@18.3.1)
|
version: 1.170.7(react-dom@18.3.1)(react@18.3.1)
|
||||||
|
lucide-react:
|
||||||
|
specifier: ^1.16.0
|
||||||
|
version: 1.16.0(react@18.3.1)
|
||||||
react:
|
react:
|
||||||
specifier: ^18.3.1
|
specifier: ^18.3.1
|
||||||
version: 18.3.1
|
version: 18.3.1
|
||||||
@ -2548,6 +2551,14 @@ packages:
|
|||||||
yallist: 3.1.1
|
yallist: 3.1.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/lucide-react@1.16.0(react@18.3.1):
|
||||||
|
resolution: {integrity: sha512-dYwyPzb4MEKpGUmNYk3WKWPnMrHs3FKM+q94kAnJrcDIqqn1hq2xY8scaS2ovsOCM5D51ey2gaRG3PBb1vgoYQ==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
dependencies:
|
||||||
|
react: 18.3.1
|
||||||
|
dev: false
|
||||||
|
|
||||||
/merge2@1.4.1:
|
/merge2@1.4.1:
|
||||||
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
|
||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user