@ruiapp/rapid-core 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -2
- package/package.json +1 -1
- package/src/dataAccess/entityManager.ts +8 -2
package/dist/index.js
CHANGED
|
@@ -2548,11 +2548,16 @@ async function findEntities(server, dataAccessor, options) {
|
|
|
2548
2548
|
return entities;
|
|
2549
2549
|
}
|
|
2550
2550
|
async function findEntity(server, dataAccessor, options) {
|
|
2551
|
-
const entities = await findEntities(server, dataAccessor,
|
|
2551
|
+
const entities = await findEntities(server, dataAccessor, {
|
|
2552
|
+
...options,
|
|
2553
|
+
...{
|
|
2554
|
+
limit: 1,
|
|
2555
|
+
},
|
|
2556
|
+
});
|
|
2552
2557
|
return lodash.first(entities);
|
|
2553
2558
|
}
|
|
2554
2559
|
async function findById(server, dataAccessor, options) {
|
|
2555
|
-
const { id, properties, keepNonPropertyFields, routeContext } = options;
|
|
2560
|
+
const { id, properties, relations, keepNonPropertyFields, routeContext } = options;
|
|
2556
2561
|
return await findEntity(server, dataAccessor, {
|
|
2557
2562
|
filters: [
|
|
2558
2563
|
{
|
|
@@ -2562,6 +2567,7 @@ async function findById(server, dataAccessor, options) {
|
|
|
2562
2567
|
},
|
|
2563
2568
|
],
|
|
2564
2569
|
properties,
|
|
2570
|
+
relations,
|
|
2565
2571
|
keepNonPropertyFields,
|
|
2566
2572
|
routeContext,
|
|
2567
2573
|
});
|
package/package.json
CHANGED
|
@@ -347,12 +347,17 @@ async function findEntities(server: IRpdServer, dataAccessor: IRpdDataAccessor,
|
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
async function findEntity(server: IRpdServer, dataAccessor: IRpdDataAccessor, options: FindEntityOptions) {
|
|
350
|
-
const entities = await findEntities(server, dataAccessor,
|
|
350
|
+
const entities = await findEntities(server, dataAccessor, {
|
|
351
|
+
...options,
|
|
352
|
+
...{
|
|
353
|
+
limit: 1,
|
|
354
|
+
},
|
|
355
|
+
});
|
|
351
356
|
return first(entities);
|
|
352
357
|
}
|
|
353
358
|
|
|
354
359
|
async function findById(server: IRpdServer, dataAccessor: IRpdDataAccessor, options: FindEntityByIdOptions): Promise<any> {
|
|
355
|
-
const { id, properties, keepNonPropertyFields, routeContext } = options;
|
|
360
|
+
const { id, properties, relations, keepNonPropertyFields, routeContext } = options;
|
|
356
361
|
return await findEntity(server, dataAccessor, {
|
|
357
362
|
filters: [
|
|
358
363
|
{
|
|
@@ -362,6 +367,7 @@ async function findById(server: IRpdServer, dataAccessor: IRpdDataAccessor, opti
|
|
|
362
367
|
},
|
|
363
368
|
],
|
|
364
369
|
properties,
|
|
370
|
+
relations,
|
|
365
371
|
keepNonPropertyFields,
|
|
366
372
|
routeContext,
|
|
367
373
|
});
|