Skip to content

Commit ef7bb9f

Browse files
authored
fix(orm): return soft delete query results to be consistent with normal query operation results (#672)
1 parent 2796bb1 commit ef7bb9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/orm/src/plugin/soft-delete-plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ export class SoftDeleteQuery<T extends SoftDeleteEntity> extends Query<T> {
9898
async restoreOne() {
9999
const patch = { [deletedAtName]: undefined } as Partial<T>;
100100
if (this.classSchema.hasProperty('deletedBy')) patch['deletedBy'] = undefined;
101-
await this.withSoftDeleted().patchOne(patch);
101+
return this.withSoftDeleted().patchOne(patch);
102102
}
103103

104104
async restoreMany() {
105105
const patch = { [deletedAtName]: undefined } as Partial<T>;
106106
if (this.classSchema.hasProperty('deletedBy')) patch['deletedBy'] = undefined;
107-
await this.withSoftDeleted().patchMany(patch);
107+
return this.withSoftDeleted().patchMany(patch);
108108
}
109109

110110
async hardDeleteOne() {
111-
await this.withSoftDeleted().deleteOne();
111+
return this.withSoftDeleted().deleteOne();
112112
}
113113

114114
async hardDeleteMany() {
115-
await this.withSoftDeleted().deleteMany();
115+
return this.withSoftDeleted().deleteMany();
116116
}
117117
}
118118

0 commit comments

Comments
 (0)