From 8309d3a92c804f7d74fda0a4ce175845898c6c2f Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Tue, 12 Nov 2024 21:34:32 +0100 Subject: [PATCH] chore(api): fix logger issue --- apps/api/src/user/webhook.ts | 5 +---- apps/api/src/utils/logger.ts | 6 ++++-- apps/app/src/routeTree.gen.ts | 25 ++++++++++++++++++++----- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/apps/api/src/user/webhook.ts b/apps/api/src/user/webhook.ts index bdb6ba5..2a35082 100644 --- a/apps/api/src/user/webhook.ts +++ b/apps/api/src/user/webhook.ts @@ -20,10 +20,7 @@ const route = createRoute({ }, }, responses: { - 200: { - content: { - 'application/json': { schema: UserOutput }, - }, + 204: { description: 'Return success', }, ...openApiErrorResponses, diff --git a/apps/api/src/utils/logger.ts b/apps/api/src/utils/logger.ts index 212df03..bee0140 100644 --- a/apps/api/src/utils/logger.ts +++ b/apps/api/src/utils/logger.ts @@ -19,7 +19,7 @@ export const logger = (): MiddlewareHandler => { direction: 'in', method, path, - userId: dbUser.id, + userId: dbUser?.id, requestId, }) @@ -31,7 +31,7 @@ export const logger = (): MiddlewareHandler => { method, path, status: c.res.status, - userId: dbUser.id, + userId: dbUser?.id, requestId, }) } @@ -42,6 +42,7 @@ export const logger = (): MiddlewareHandler => { method, path, status: c.res.status, + userId: dbUser?.id, requestId, }) } @@ -52,6 +53,7 @@ export const logger = (): MiddlewareHandler => { method, path, status: c.res.status, + userId: dbUser?.id, requestId, }) } diff --git a/apps/app/src/routeTree.gen.ts b/apps/app/src/routeTree.gen.ts index bddaa66..9ac9c0a 100644 --- a/apps/app/src/routeTree.gen.ts +++ b/apps/app/src/routeTree.gen.ts @@ -1,12 +1,12 @@ -/* prettier-ignore-start */ - /* eslint-disable */ // @ts-nocheck // noinspection JSUnusedGlobalSymbols -// This file is auto-generated by TanStack Router +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. import { createFileRoute } from '@tanstack/react-router' @@ -39,26 +39,31 @@ const ChangelogIdEditLazyImport = createFileRoute('/changelog/$id/edit')() // Create/Update Routes const CliLazyRoute = CliLazyImport.update({ + id: '/cli', path: '/cli', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/cli.lazy').then((d) => d.Route)) const IndexLazyRoute = IndexLazyImport.update({ + id: '/', path: '/', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/index.lazy').then((d) => d.Route)) const UserIndexLazyRoute = UserIndexLazyImport.update({ + id: '/user/', path: '/user/', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/user/index.lazy').then((d) => d.Route)) const PageIndexLazyRoute = PageIndexLazyImport.update({ + id: '/page/', path: '/page/', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/page.index.lazy').then((d) => d.Route)) const ChangelogIndexLazyRoute = ChangelogIndexLazyImport.update({ + id: '/changelog/', path: '/changelog/', getParentRoute: () => rootRoute, } as any).lazy(() => @@ -66,6 +71,7 @@ const ChangelogIndexLazyRoute = ChangelogIndexLazyImport.update({ ) const AccessTokensIndexLazyRoute = AccessTokensIndexLazyImport.update({ + id: '/access-tokens/', path: '/access-tokens/', getParentRoute: () => rootRoute, } as any).lazy(() => @@ -73,16 +79,19 @@ const AccessTokensIndexLazyRoute = AccessTokensIndexLazyImport.update({ ) const PageCreateLazyRoute = PageCreateLazyImport.update({ + id: '/page/create', path: '/page/create', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/page.create.lazy').then((d) => d.Route)) const PageIdLazyRoute = PageIdLazyImport.update({ + id: '/page/$id', path: '/page/$id', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/page.$id.lazy').then((d) => d.Route)) const ChangelogCreateLazyRoute = ChangelogCreateLazyImport.update({ + id: '/changelog/create', path: '/changelog/create', getParentRoute: () => rootRoute, } as any).lazy(() => @@ -90,11 +99,13 @@ const ChangelogCreateLazyRoute = ChangelogCreateLazyImport.update({ ) const ChangelogIdLazyRoute = ChangelogIdLazyImport.update({ + id: '/changelog/$id', path: '/changelog/$id', getParentRoute: () => rootRoute, } as any).lazy(() => import('./routes/changelog.$id.lazy').then((d) => d.Route)) const AccessTokensNewLazyRoute = AccessTokensNewLazyImport.update({ + id: '/access-tokens/new', path: '/access-tokens/new', getParentRoute: () => rootRoute, } as any).lazy(() => @@ -102,6 +113,7 @@ const AccessTokensNewLazyRoute = AccessTokensNewLazyImport.update({ ) const PageIdIndexLazyRoute = PageIdIndexLazyImport.update({ + id: '/', path: '/', getParentRoute: () => PageIdLazyRoute, } as any).lazy(() => @@ -109,6 +121,7 @@ const PageIdIndexLazyRoute = PageIdIndexLazyImport.update({ ) const ChangelogIdIndexLazyRoute = ChangelogIdIndexLazyImport.update({ + id: '/', path: '/', getParentRoute: () => ChangelogIdLazyRoute, } as any).lazy(() => @@ -116,12 +129,14 @@ const ChangelogIdIndexLazyRoute = ChangelogIdIndexLazyImport.update({ ) const PageIdEditLazyRoute = PageIdEditLazyImport.update({ + id: '/edit', path: '/edit', getParentRoute: () => PageIdLazyRoute, } as any).lazy(() => import('./routes/page.$id.edit.lazy').then((d) => d.Route)) const ChangelogIdVersionCreateLazyRoute = ChangelogIdVersionCreateLazyImport.update({ + id: '/versionCreate', path: '/versionCreate', getParentRoute: () => ChangelogIdLazyRoute, } as any).lazy(() => @@ -129,6 +144,7 @@ const ChangelogIdVersionCreateLazyRoute = ) const ChangelogIdEditLazyRoute = ChangelogIdEditLazyImport.update({ + id: '/edit', path: '/edit', getParentRoute: () => ChangelogIdLazyRoute, } as any).lazy(() => @@ -137,6 +153,7 @@ const ChangelogIdEditLazyRoute = ChangelogIdEditLazyImport.update({ const ChangelogIdVersionVersionIdRoute = ChangelogIdVersionVersionIdImport.update({ + id: '/version/$versionId', path: '/version/$versionId', getParentRoute: () => ChangelogIdLazyRoute, } as any) @@ -451,8 +468,6 @@ export const routeTree = rootRoute ._addFileChildren(rootRouteChildren) ._addFileTypes() -/* prettier-ignore-end */ - /* ROUTE_MANIFEST_START { "routes": {