Skip to content

Commit b35a6a8

Browse files
committed
chore(server-nestjs): reformat files
1 parent b6095fd commit b35a6a8

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/server/src/nestjs/api-handler.service.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DbClientContract } from '@zenstackhq/runtime';
2-
import { HttpException, Inject, Injectable, Scope, } from "@nestjs/common";
3-
import { HttpAdapterHost, REQUEST, } from "@nestjs/core";
2+
import { HttpException, Inject, Injectable, Scope } from "@nestjs/common";
3+
import { HttpAdapterHost, REQUEST } from "@nestjs/core";
44
import { loadAssets } from "../shared";
55
import { RPCApiHandler } from '../api/rpc';
66
import { ENHANCED_PRISMA } from "./zenstack.constants";
@@ -11,9 +11,13 @@ import { ApiHandlerOptions } from './interfaces';
1111
* and forward them to the ZenStack API handler. It is platform agnostic and can be used
1212
* with any HTTP adapter.
1313
*/
14-
@Injectable({scope: Scope.REQUEST})
14+
@Injectable({ scope: Scope.REQUEST })
1515
export class ApiHandlerService {
16-
constructor(private readonly httpAdapterHost: HttpAdapterHost, @Inject(ENHANCED_PRISMA) private readonly prisma: DbClientContract, @Inject(REQUEST) private readonly request: unknown) {}
16+
constructor(
17+
private readonly httpAdapterHost: HttpAdapterHost,
18+
@Inject(ENHANCED_PRISMA) private readonly prisma: DbClientContract,
19+
@Inject(REQUEST) private readonly request: unknown
20+
) { }
1721

1822
async handleRequest(options?: ApiHandlerOptions): Promise<unknown> {
1923
const { modelMeta, zodSchemas } = loadAssets(options || {});
@@ -26,9 +30,9 @@ export class ApiHandlerService {
2630
const path = options?.baseUrl && url.pathname.startsWith(options.baseUrl) ? url.pathname.slice(options.baseUrl.length) : url.pathname;
2731
const searchParams = url.searchParams;
2832
const query = Object.fromEntries(searchParams);
29-
const requestBody = (this.request as {body: unknown}).body;
33+
const requestBody = (this.request as { body: unknown }).body;
3034

31-
const response = await requestHandler({
35+
const response = await requestHandler({
3236
method,
3337
path,
3438
query,

packages/server/src/nestjs/interfaces/zenstack-module-options.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface ZenStackModuleOptions {
77
/**
88
* A callback for getting an enhanced `PrismaClient`.
99
*/
10-
getEnhancedPrisma: (model?: string | symbol ) => unknown;
10+
getEnhancedPrisma: (model?: string | symbol) => unknown;
1111
}
1212

1313
/**

0 commit comments

Comments
 (0)