@tomei/rental 0.17.4-dev.3 → 0.17.4-dev.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/rental",
3
- "version": "0.17.4-dev.3",
3
+ "version": "0.17.4-dev.5",
4
4
  "description": "Tomei Rental Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -828,8 +828,14 @@ export class RentalHirerChangeRequest
828
828
  //find the number of joint hirers after removal
829
829
  const rental = await Rental.init(dbTransaction, this.RentalId);
830
830
  const jointHirers = await rental.getJointHirers(dbTransaction);
831
+
832
+ //filter out the active joint hirers
833
+ const activeJointHirers = jointHirers.filter(
834
+ (hirer) => hirer.Status === 'Active',
835
+ );
836
+
831
837
  //if jointHirers is empty, set rental.AccountType to "Single"
832
- if (jointHirers.length === 0) {
838
+ if (activeJointHirers.length === 0) {
833
839
  await rental.update(loginUser, dbTransaction, {
834
840
  AccountType: RentalAccountTypeEnum.SINGLE,
835
841
  });