Skip to content

Commit

Permalink
use consistent casing
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Mar 31, 2024
1 parent 33fefa2 commit 4a9be8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/express/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { DbClientContract } from '@zenstackhq/runtime';
import type { Handler, Request, Response } from 'express';
import RPCAPIHandler from '../api/rpc';
import { RPCApiHandler } from '../api/rpc';
import { loadAssets } from '../shared';
import { AdapterBaseOptions } from '../types';

Expand Down Expand Up @@ -32,7 +32,7 @@ export interface MiddlewareOptions extends AdapterBaseOptions {
const factory = (options: MiddlewareOptions): Handler => {
const { modelMeta, zodSchemas } = loadAssets(options);

const requestHandler = options.handler || RPCAPIHandler();
const requestHandler = options.handler || RPCApiHandler();

return async (request, response, next) => {
const prisma = (await options.getPrisma(request, response)) as DbClientContract;
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/next/app-route-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { DbClientContract } from '@zenstackhq/runtime';
import { NextRequest, NextResponse } from 'next/server';
import { AppRouteRequestHandlerOptions } from '.';
import RPCAPIHandler from '../api/rpc';
import { RPCApiHandler } from '../api';
import { loadAssets } from '../shared';

type Context = { params: { path: string[] } };
Expand All @@ -19,7 +19,7 @@ export default function factory(
): (req: NextRequest, context: Context) => Promise<NextResponse> {
const { modelMeta, zodSchemas } = loadAssets(options);

const requestHandler = options.handler || RPCAPIHandler();
const requestHandler = options.handler || RPCApiHandler();

return async (req: NextRequest, context: Context) => {
const prisma = (await options.getPrisma(req)) as DbClientContract;
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/next/pages-route-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { DbClientContract } from '@zenstackhq/runtime';
import { NextApiRequest, NextApiResponse } from 'next';
import { PagesRouteRequestHandlerOptions } from '.';
import RPCAPIHandler from '../api/rpc';
import { RPCApiHandler } from '../api';
import { loadAssets } from '../shared';

/**
Expand All @@ -17,7 +17,7 @@ export default function factory(
): (req: NextApiRequest, res: NextApiResponse) => Promise<void> {
const { modelMeta, zodSchemas } = loadAssets(options);

const requestHandler = options.handler || RPCAPIHandler();
const requestHandler = options.handler || RPCApiHandler();

return async (req: NextApiRequest, res: NextApiResponse) => {
const prisma = (await options.getPrisma(req, res)) as DbClientContract;
Expand Down
4 changes: 2 additions & 2 deletions packages/server/tests/api/rpc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CrudFailureReason, type ZodSchemas } from '@zenstackhq/runtime';
import { loadSchema } from '@zenstackhq/testtools';
import { Decimal } from 'decimal.js';
import SuperJSON from 'superjson';
import RPCAPIHandler from '../../src/api/rpc';
import { RPCApiHandler } from '../../src/api';
import { schema } from '../utils';

describe('RPC API Handler Tests', () => {
Expand Down Expand Up @@ -408,7 +408,7 @@ describe('RPC API Handler Tests', () => {
});

function makeHandler(zodSchemas?: ZodSchemas) {
const _handler = RPCAPIHandler();
const _handler = RPCApiHandler();
return async (args: any) => {
const r = await _handler({ ...args, url: new URL(`http://localhost/${args.path}`), modelMeta, zodSchemas });
return {
Expand Down

0 comments on commit 4a9be8a

Please sign in to comment.