MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / loadThisEntity

Function loadThisEntity

packages/orm/src/client/crud/operations/base.ts:1191–1199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

updateFunction · 0.85

Calls 1

createNotFoundErrorFunction · 0.90

Tested by

no test coverage detected