Skip to content

Commit c6de79f

Browse files
committed
fix: replace hardcoded valid operations with CoreCrudOperations import
1 parent f3c6db8 commit c6de79f

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

packages/server/src/api/rpc/index.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { lowerCaseFirst, safeJSONStringify } from '@zenstackhq/common-helpers';
2-
import { ORMError, ORMErrorReason, type ClientContract } from '@zenstackhq/orm';
2+
import { CoreCrudOperations, ORMError, ORMErrorReason, type ClientContract } from '@zenstackhq/orm';
33
import type { SchemaDef } from '@zenstackhq/orm/schema';
44
import SuperJSON from 'superjson';
55
import { match } from 'ts-pattern';
@@ -12,24 +12,7 @@ import { processSuperJsonRequestPayload, unmarshalQ } from '../common/utils';
1212
import { log, registerCustomSerializers } from '../utils';
1313

1414
const TRANSACTION_ROUTE_PREFIX = '$transaction' as const;
15-
const VALID_OPS = new Set([
16-
'create',
17-
'createMany',
18-
'createManyAndReturn',
19-
'upsert',
20-
'findFirst',
21-
'findUnique',
22-
'findMany',
23-
'aggregate',
24-
'groupBy',
25-
'count',
26-
'exists',
27-
'update',
28-
'updateMany',
29-
'updateManyAndReturn',
30-
'delete',
31-
'deleteMany',
32-
]);
15+
const VALID_OPS = new Set(CoreCrudOperations as unknown as string[]);
3316

3417
registerCustomSerializers();
3518

0 commit comments

Comments
 (0)