Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 7db9c7c

Browse files
committed
fix: rpc update handling
1 parent 135a5e6 commit 7db9c7c

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

packages/orm/src/client/crud/dialects/base-dialect.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,16 @@ export abstract class BaseCrudDialect<Schema extends SchemaDef> {
448448
}
449449

450450
private buildArrayFilter(fieldRef: Expression<any>, fieldDef: FieldDef, payload: any) {
451-
const clauses: Expression<SqlBool>[] = [];
452451
const fieldType = fieldDef.type as BuiltinType;
453452

453+
// Allow direct array payloads to mean equality on the list
454+
if (Array.isArray(payload)) {
455+
const value = this.transformPrimitive(payload, fieldType, !!fieldDef.array);
456+
return this.buildLiteralFilter(fieldRef, fieldType, this.eb.val(value));
457+
}
458+
459+
const clauses: Expression<SqlBool>[] = [];
460+
454461
for (const [key, _value] of Object.entries(payload)) {
455462
if (_value === undefined) {
456463
continue;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,17 @@ export class RPCApiHandler<Schema extends SchemaDef = SchemaDef> implements ApiH
221221
}
222222

223223
private async processRequestPayload(args: any) {
224-
const { meta, ...rest } = args;
224+
const { meta, ...rest } = args ?? {};
225225
if (meta?.serialization) {
226226
try {
227227
// superjson deserialization
228228
args = SuperJSON.deserialize({ json: rest, meta: meta.serialization });
229229
} catch (err) {
230230
return { result: undefined, error: `failed to deserialize request payload: ${(err as Error).message}` };
231231
}
232+
} else {
233+
// drop meta when no serialization info is present
234+
args = rest;
232235
}
233236
return { result: args, error: undefined };
234237
}

0 commit comments

Comments
 (0)