You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FindById has the below statement which can be reduced by checking the deleted flag and in turn improving performance
const entityToRemove = await super.findOne(filter, options);
if (entityToRemove) {
// Now call super
return super.findById(id, filter, options);
}
else {
throw new rest_1.HttpErrors.NotFound("EntityNotFound" /* ErrorKeys.EntityNotFound */);
}
The text was updated successfully, but these errors were encountered:
mlakdawala-sf
changed the title
Multiple DB calls while using findById
multiple DB calls while using findById
Sep 2, 2022
FindById has the below statement which can be reduced by checking the deleted flag and in turn improving performance
const entityToRemove = await super.findOne(filter, options);
if (entityToRemove) {
// Now call super
return super.findById(id, filter, options);
}
else {
throw new rest_1.HttpErrors.NotFound("EntityNotFound" /* ErrorKeys.EntityNotFound */);
}
The text was updated successfully, but these errors were encountered: