()
| 1189 | // lazily load the entity to be updated |
| 1190 | let thisEntity: any; |
| 1191 | const loadThisEntity = async () => { |
| 1192 | if (thisEntity === undefined) { |
| 1193 | thisEntity = (await this.getEntityIds(kysely, model, origWhere)) ?? null; |
| 1194 | if (!thisEntity && throwIfNotFound) { |
| 1195 | throw createNotFoundError(model); |
| 1196 | } |
| 1197 | } |
| 1198 | return thisEntity; |
| 1199 | }; |
| 1200 | |
| 1201 | if (Object.keys(finalData).length === 0) { |
| 1202 | return loadThisEntity(); |
no test coverage detected