@punks/backend-entity-manager 0.0.399 → 0.0.401
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/cjs/index.js +6 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/integrations/repository/typeorm/repository.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/decorators/pipelines.d.ts +0 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/integrations/repository/typeorm/repository.d.ts +1 -0
- package/dist/esm/types/platforms/nest/decorators/pipelines.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1085,7 +1085,7 @@ class EntityUpdateCommand {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
const authorizationResult = await authorization.canUpdate(currentEntity, context);
|
|
1087
1087
|
if (!authorizationResult.isAuthorized)
|
|
1088
|
-
throw new EntityOperationUnauthorizedException(exports.EntityOperationType.
|
|
1088
|
+
throw new EntityOperationUnauthorizedException(exports.EntityOperationType.Update, this.services.getEntityName(), currentEntity);
|
|
1089
1089
|
}
|
|
1090
1090
|
async getContext() {
|
|
1091
1091
|
const authorization = this.services.resolveAuthorizationMiddleware();
|
|
@@ -4050,6 +4050,11 @@ class TypeOrmRepository {
|
|
|
4050
4050
|
this.logger.debug("Finding entities by condition", { condition });
|
|
4051
4051
|
return await this.innerRepository.find(condition);
|
|
4052
4052
|
}
|
|
4053
|
+
async findOne(condition) {
|
|
4054
|
+
this.logger.debug("Finding entity by condition", { condition });
|
|
4055
|
+
const items = await this.innerRepository.find(condition);
|
|
4056
|
+
return items[0];
|
|
4057
|
+
}
|
|
4053
4058
|
async findById(id) {
|
|
4054
4059
|
this.logger.debug("Finding entities by id", { id });
|
|
4055
4060
|
return await this.innerRepository.findBy({
|