Skip to content

Commit 4180576

Browse files
committed
update
1 parent 2826974 commit 4180576

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/runtime/src/enhancements/node/delegate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ export class DelegateProxyHandler extends DefaultPrismaProxyHandler {
902902
} else {
903903
// translate to plain `update` for nested write into base fields
904904
const findArgs = {
905-
where: clone(args.where),
905+
where: clone(args.where ?? {}),
906906
select: this.queryUtils.makeIdSelection(model),
907907
};
908908
await this.injectUpdateHierarchy(db, model, findArgs);
@@ -1095,7 +1095,7 @@ export class DelegateProxyHandler extends DefaultPrismaProxyHandler {
10951095
private async doDeleteMany(db: CrudContract, model: string, where: any): Promise<{ count: number }> {
10961096
// query existing entities with id
10971097
const idSelection = this.queryUtils.makeIdSelection(model);
1098-
const findArgs = { where: clone(where), select: idSelection };
1098+
const findArgs = { where: clone(where ?? {}), select: idSelection };
10991099
this.injectWhereHierarchy(model, findArgs.where);
11001100

11011101
if (this.options.logPrismaQuery) {

packages/runtime/src/enhancements/node/policy/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ export class PolicyProxyHandler<DbClient extends DbClientContract> implements Pr
10901090

10911091
// convert upsert to update
10921092
const convertedUpdate = {
1093-
where: args.where,
1093+
where: args.where ?? {},
10941094
data: this.validateUpdateInputSchema(model, args.update),
10951095
};
10961096
this.mergeToParent(context.parent, 'update', convertedUpdate);

packages/testtools/src/schema.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ datasource db {
9696
9797
generator js {
9898
provider = 'prisma-client-js'
99-
${options.previewFeatures ? `previewFeatures = ${JSON.stringify(options.previewFeatures)}` : ''}
99+
${
100+
options.previewFeatures
101+
? `previewFeatures = ${JSON.stringify(options.previewFeatures)}`
102+
: 'previewFeatures = ["strictUndefinedChecks"]'
103+
}
100104
}
101105
102106
plugin enhancer {

0 commit comments

Comments
 (0)