@tomei/sso 0.33.3 → 0.33.5

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/sso",
3
- "version": "0.33.3",
3
+ "version": "0.33.5",
4
4
  "description": "Tomei SSO Package",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -485,9 +485,7 @@ export class Group extends ObjectBase {
485
485
 
486
486
  if (Search) {
487
487
  Object.entries(Search).forEach(([key, value]) => {
488
- queryObj[key] = {
489
- [Op.eq]: value,
490
- };
488
+ queryObj[key] = value;
491
489
  });
492
490
  }
493
491
 
@@ -502,14 +500,13 @@ export class Group extends ObjectBase {
502
500
  ...options,
503
501
  limit: Rows,
504
502
  offset: Rows * (Page - 1),
505
- order: [
506
- ['CreatedAt', 'DESC'],
507
- ['Status', 'Active'],
508
- ],
503
+ order: [['CreatedAt', 'DESC']],
509
504
  };
510
505
  }
511
506
 
512
- const systemAccess = await Group._GroupSystemAccessRepo.findAndCountAll();
507
+ const systemAccess = await Group._GroupSystemAccessRepo.findAndCountAll(
508
+ options,
509
+ );
513
510
  return systemAccess;
514
511
  } catch (error) {
515
512
  return error;
@@ -706,7 +703,7 @@ export class Group extends ObjectBase {
706
703
  { SystemCode: SystemCode },
707
704
  );
708
705
 
709
- if (!currentGroupSystemAccess) {
706
+ if (currentGroupSystemAccess.count < 1) {
710
707
  throw new ClassError(
711
708
  'Group',
712
709
  'GroupErrMsg10',
@@ -721,13 +718,13 @@ export class Group extends ObjectBase {
721
718
  );
722
719
 
723
720
  const EntityValueBefore = {
724
- GroupCode: currentGroupSystemAccess.GroupCode,
725
- SystemCode: currentGroupSystemAccess.SystemCode,
726
- Status: currentGroupSystemAccess.Status,
727
- CreatedById: currentGroupSystemAccess.CreatedById,
728
- CreatedAt: currentGroupSystemAccess.CreatedAt,
729
- UpdatedById: currentGroupSystemAccess.UpdatedById,
730
- UpdatedAt: currentGroupSystemAccess.UpdatedAt,
721
+ GroupCode: currentGroupSystemAccess?.rows[0]?.GroupCode,
722
+ SystemCode: currentGroupSystemAccess?.rows[0]?.SystemCode,
723
+ Status: currentGroupSystemAccess?.rows[0]?.Status,
724
+ CreatedById: currentGroupSystemAccess?.rows[0]?.CreatedById,
725
+ CreatedAt: currentGroupSystemAccess?.rows[0]?.CreatedAt,
726
+ UpdatedById: currentGroupSystemAccess?.rows[0]?.UpdatedById,
727
+ UpdatedAt: currentGroupSystemAccess?.rows[0]?.UpdatedAt,
731
728
  };
732
729
 
733
730
  const activity = new Activity();
@@ -736,7 +733,7 @@ export class Group extends ObjectBase {
736
733
  activity.Description = 'Delete Group System Access';
737
734
  activity.EntityType = 'GroupSystemAccess';
738
735
  activity.EntityId =
739
- currentGroupSystemAccess.GroupSystemAccessId?.toString();
736
+ currentGroupSystemAccess?.rows[0]?.GroupSystemAccessId?.toString();
740
737
  activity.EntityValueBefore = JSON.stringify(EntityValueBefore);
741
738
  activity.EntityValueAfter = JSON.stringify({});
742
739