@crystaldesign/diva-archive 26.3.1-rc.0 → 26.3.1

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.
Files changed (2) hide show
  1. package/build/esm/index.js +218 -136
  2. package/package.json +3 -3
@@ -348,7 +348,7 @@ function getAction(_ref2) {
348
348
  case 'pdf':
349
349
  return openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t, action, reportHandler);
350
350
  case 'planner':
351
- return openPlannerAction(openComponent, updateBreadcrumbs);
351
+ return openPlannerAction(openComponent, updateBreadcrumbs, openModal, organization, canAccessOrganization, t);
352
352
  case 'sendToIwoFurn':
353
353
  return sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openModal, t);
354
354
  case 'order':
@@ -536,8 +536,8 @@ function openPdfAction(openComponent, openSnackBar, toggleLoading, openModal, t,
536
536
  }
537
537
  };
538
538
  }
539
- function openPlannerAction(openComponent, updateBreadcrumbs) {
540
- return function (item) {
539
+ function openPlannerAction(openComponent, updateBreadcrumbs, openModal, organization, canAccessOrganization, t) {
540
+ var openInCurrentOrg = function openInCurrentOrg(item) {
541
541
  updateBreadcrumbs({
542
542
  type: 'replace',
543
543
  groupId: 'ARCHIVE',
@@ -576,6 +576,88 @@ function openPlannerAction(openComponent, updateBreadcrumbs) {
576
576
  });
577
577
  }
578
578
  };
579
+ var openInTargetOrg = function openInTargetOrg(item) {
580
+ var url = window.location.origin + '/planner?lang=de' + '&organizationId=' + item.OrganizationId + '&divaNr=' + item.DivaNr + '&assignNewDivaNr=' + (item.OrderStatus === 'SEND' ? 'true' : 'false');
581
+ openComponent({
582
+ url: url
583
+ });
584
+ };
585
+ return /*#__PURE__*/function () {
586
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
587
+ var _organization$type2, _organization$type2$t, modalTitle, hasAccessToTargetOrg, organizationType, isWrapperLikeOrganization;
588
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
589
+ while (1) switch (_context2.prev = _context2.next) {
590
+ case 0:
591
+ if (!(item.OrganizationId && item.OrganizationId !== organization._id)) {
592
+ _context2.next = 10;
593
+ break;
594
+ }
595
+ modalTitle = t('action.archive.edit.cannotopen');
596
+ hasAccessToTargetOrg = canAccessOrganization(item.OrganizationId);
597
+ if (hasAccessToTargetOrg) {
598
+ _context2.next = 5;
599
+ break;
600
+ }
601
+ return _context2.abrupt("return", openInCurrentOrg(item));
602
+ case 5:
603
+ organizationType = organization === null || organization === void 0 || (_organization$type2 = organization.type) === null || _organization$type2 === void 0 || (_organization$type2$t = _organization$type2.toUpperCase) === null || _organization$type2$t === void 0 ? void 0 : _organization$type2$t.call(_organization$type2);
604
+ isWrapperLikeOrganization = !(organization !== null && organization !== void 0 && organization.type) && !(organization !== null && organization !== void 0 && organization.parentType) || organizationType === 'SUPPLIER' || organizationType === 'SUPLIER';
605
+ if (!isWrapperLikeOrganization) {
606
+ _context2.next = 9;
607
+ break;
608
+ }
609
+ return _context2.abrupt("return", openModal({
610
+ title: modalTitle,
611
+ text: t('action.archive.edit.otherorganizationdetail', {
612
+ suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
613
+ }),
614
+ reject: true,
615
+ accept: true,
616
+ callback: function callback(accept) {
617
+ if (accept) {
618
+ openInTargetOrg(item);
619
+ }
620
+ }
621
+ }));
622
+ case 9:
623
+ return _context2.abrupt("return", openModal({
624
+ title: modalTitle,
625
+ rejectByIcon: true,
626
+ text: t('action.archive.edit.otherorganizationdetail', {
627
+ suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
628
+ }),
629
+ actions: [{
630
+ text: t('action.archive.edit.openincurrentorg'),
631
+ id: 'currentOrg',
632
+ variant: 'outlined',
633
+ closeable: true
634
+ }, {
635
+ text: t('action.archive.edit.openintargetorg', {
636
+ suborganization: item === null || item === void 0 ? void 0 : item.OrganizationId_displayText
637
+ }),
638
+ id: 'targetOrg',
639
+ variant: 'contained'
640
+ }],
641
+ callback: function callback(result) {
642
+ if (result === 'currentOrg') {
643
+ openInCurrentOrg(item);
644
+ } else if (result === 'targetOrg') {
645
+ openInTargetOrg(item);
646
+ }
647
+ }
648
+ }));
649
+ case 10:
650
+ return _context2.abrupt("return", openInCurrentOrg(item));
651
+ case 11:
652
+ case "end":
653
+ return _context2.stop();
654
+ }
655
+ }, _callee2);
656
+ }));
657
+ return function (_x2) {
658
+ return _ref4.apply(this, arguments);
659
+ };
660
+ }();
579
661
  }
580
662
  function openEmailAction(sendEmail, t, action, organization, user) {
581
663
  return function (item) {
@@ -591,15 +673,15 @@ function openEmailAction(sendEmail, t, action, organization, user) {
591
673
  }
592
674
  function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openModal, t) {
593
675
  return /*#__PURE__*/function () {
594
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
676
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(item) {
595
677
  var result;
596
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
597
- while (1) switch (_context2.prev = _context2.next) {
678
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
679
+ while (1) switch (_context3.prev = _context3.next) {
598
680
  case 0:
599
- _context2.next = 2;
681
+ _context3.next = 2;
600
682
  return sendToIwofurn(apiConfig, jwt, item.DivaNr, Number(item.DocumentVersion), toggleLoading);
601
683
  case 2:
602
- result = _context2.sent;
684
+ result = _context3.sent;
603
685
  if (result === true) {
604
686
  openModal({
605
687
  accept: true,
@@ -618,34 +700,34 @@ function sendToIwoFurnAction(apiConfig, jwt, toggleLoading, setReloadPage, openM
618
700
  }
619
701
  case 4:
620
702
  case "end":
621
- return _context2.stop();
703
+ return _context3.stop();
622
704
  }
623
- }, _callee2);
705
+ }, _callee3);
624
706
  }));
625
- return function (_x2) {
626
- return _ref4.apply(this, arguments);
707
+ return function (_x3) {
708
+ return _ref5.apply(this, arguments);
627
709
  };
628
710
  }();
629
711
  }
630
- function placeOrderAction(_ref5) {
631
- var apiConfig = _ref5.apiConfig,
632
- jwt = _ref5.jwt,
633
- organization = _ref5.organization,
634
- sendEmail = _ref5.sendEmail,
635
- openModal = _ref5.openModal,
636
- t = _ref5.t,
637
- action = _ref5.action,
638
- setReloadPage = _ref5.setReloadPage;
712
+ function placeOrderAction(_ref6) {
713
+ var apiConfig = _ref6.apiConfig,
714
+ jwt = _ref6.jwt,
715
+ organization = _ref6.organization,
716
+ sendEmail = _ref6.sendEmail,
717
+ openModal = _ref6.openModal,
718
+ t = _ref6.t,
719
+ action = _ref6.action,
720
+ setReloadPage = _ref6.setReloadPage;
639
721
  return /*#__PURE__*/function () {
640
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(item, id, updateOne) {
641
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
642
- while (1) switch (_context4.prev = _context4.next) {
722
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(item, id, updateOne) {
723
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
724
+ while (1) switch (_context5.prev = _context5.next) {
643
725
  case 0:
644
726
  if (jwt) {
645
- _context4.next = 2;
727
+ _context5.next = 2;
646
728
  break;
647
729
  }
648
- return _context4.abrupt("return");
730
+ return _context5.abrupt("return");
649
731
  case 2:
650
732
  triggerSendEmail({
651
733
  sendEmail: sendEmail,
@@ -654,12 +736,12 @@ function placeOrderAction(_ref5) {
654
736
  action: action,
655
737
  item: item,
656
738
  callback: function () {
657
- var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(success) {
658
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
659
- while (1) switch (_context3.prev = _context3.next) {
739
+ var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(success) {
740
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
741
+ while (1) switch (_context4.prev = _context4.next) {
660
742
  case 0:
661
743
  if (!(success == 'SUCCESS')) {
662
- _context3.next = 7;
744
+ _context4.next = 7;
663
745
  break;
664
746
  }
665
747
  openModal({
@@ -669,13 +751,13 @@ function placeOrderAction(_ref5) {
669
751
  return setReloadPage(1);
670
752
  }
671
753
  });
672
- _context3.next = 4;
754
+ _context4.next = 4;
673
755
  return setOrdered(apiConfig, item.OrganizationId, jwt, item.DivaNr, parseInt(item.DocumentVersion));
674
756
  case 4:
675
757
  updateOne(_objectSpread$2(_objectSpread$2({}, item), {}, {
676
758
  OrderStatus: 'SEND'
677
759
  }));
678
- _context3.next = 8;
760
+ _context4.next = 8;
679
761
  break;
680
762
  case 7:
681
763
  openModal({
@@ -685,11 +767,11 @@ function placeOrderAction(_ref5) {
685
767
  });
686
768
  case 8:
687
769
  case "end":
688
- return _context3.stop();
770
+ return _context4.stop();
689
771
  }
690
- }, _callee3);
772
+ }, _callee4);
691
773
  }));
692
- function callback(_x6) {
774
+ function callback(_x7) {
693
775
  return _callback.apply(this, arguments);
694
776
  }
695
777
  return callback;
@@ -697,56 +779,56 @@ function placeOrderAction(_ref5) {
697
779
  });
698
780
  case 3:
699
781
  case "end":
700
- return _context4.stop();
782
+ return _context5.stop();
701
783
  }
702
- }, _callee4);
784
+ }, _callee5);
703
785
  }));
704
- return function (_x3, _x4, _x5) {
705
- return _ref6.apply(this, arguments);
786
+ return function (_x4, _x5, _x6) {
787
+ return _ref7.apply(this, arguments);
706
788
  };
707
789
  }();
708
790
  }
709
- function setArchivedAction(_ref7) {
710
- var apiConfig = _ref7.apiConfig,
711
- jwt = _ref7.jwt,
712
- openModal = _ref7.openModal,
713
- t = _ref7.t,
714
- trashed = _ref7.trashed;
791
+ function setArchivedAction(_ref8) {
792
+ var apiConfig = _ref8.apiConfig,
793
+ jwt = _ref8.jwt,
794
+ openModal = _ref8.openModal,
795
+ t = _ref8.t,
796
+ trashed = _ref8.trashed;
715
797
  return /*#__PURE__*/function () {
716
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(item, id, updateOne, deleteOne) {
717
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
718
- while (1) switch (_context6.prev = _context6.next) {
798
+ var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(item, id, updateOne, deleteOne) {
799
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
800
+ while (1) switch (_context7.prev = _context7.next) {
719
801
  case 0:
720
802
  if (jwt) {
721
- _context6.next = 2;
803
+ _context7.next = 2;
722
804
  break;
723
805
  }
724
- return _context6.abrupt("return");
806
+ return _context7.abrupt("return");
725
807
  case 2:
726
808
  openModal({
727
809
  accept: true,
728
810
  reject: true,
729
811
  title: t(trashed ? 'order.restore' : 'order.delete'),
730
812
  callback: function () {
731
- var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(accepted) {
732
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
733
- while (1) switch (_context5.prev = _context5.next) {
813
+ var _callback2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(accepted) {
814
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
815
+ while (1) switch (_context6.prev = _context6.next) {
734
816
  case 0:
735
817
  if (!accepted) {
736
- _context5.next = 4;
818
+ _context6.next = 4;
737
819
  break;
738
820
  }
739
- _context5.next = 3;
821
+ _context6.next = 3;
740
822
  return setArchived(apiConfig, jwt, item.DivaNr, !trashed);
741
823
  case 3:
742
824
  deleteOne();
743
825
  case 4:
744
826
  case "end":
745
- return _context5.stop();
827
+ return _context6.stop();
746
828
  }
747
- }, _callee5);
829
+ }, _callee6);
748
830
  }));
749
- function callback(_x11) {
831
+ function callback(_x12) {
750
832
  return _callback2.apply(this, arguments);
751
833
  }
752
834
  return callback;
@@ -754,31 +836,31 @@ function setArchivedAction(_ref7) {
754
836
  });
755
837
  case 3:
756
838
  case "end":
757
- return _context6.stop();
839
+ return _context7.stop();
758
840
  }
759
- }, _callee6);
841
+ }, _callee7);
760
842
  }));
761
- return function (_x7, _x8, _x9, _x10) {
762
- return _ref8.apply(this, arguments);
843
+ return function (_x8, _x9, _x10, _x11) {
844
+ return _ref9.apply(this, arguments);
763
845
  };
764
846
  }();
765
847
  }
766
- function deleteAction(_ref9) {
767
- var apiConfig = _ref9.apiConfig,
768
- jwt = _ref9.jwt,
769
- openModal = _ref9.openModal,
770
- t = _ref9.t,
771
- trashed = _ref9.trashed;
848
+ function deleteAction(_ref10) {
849
+ var apiConfig = _ref10.apiConfig,
850
+ jwt = _ref10.jwt,
851
+ openModal = _ref10.openModal,
852
+ t = _ref10.t,
853
+ trashed = _ref10.trashed;
772
854
  return /*#__PURE__*/function () {
773
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(item, id, updateOne, deleteOne) {
774
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
775
- while (1) switch (_context8.prev = _context8.next) {
855
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(item, id, updateOne, deleteOne) {
856
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
857
+ while (1) switch (_context9.prev = _context9.next) {
776
858
  case 0:
777
859
  if (jwt) {
778
- _context8.next = 2;
860
+ _context9.next = 2;
779
861
  break;
780
862
  }
781
- return _context8.abrupt("return");
863
+ return _context9.abrupt("return");
782
864
  case 2:
783
865
  openModal({
784
866
  accept: true,
@@ -787,25 +869,25 @@ function deleteAction(_ref9) {
787
869
  divaNr: item.DivaNr
788
870
  }),
789
871
  callback: function () {
790
- var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(accepted) {
791
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
792
- while (1) switch (_context7.prev = _context7.next) {
872
+ var _callback3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(accepted) {
873
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
874
+ while (1) switch (_context8.prev = _context8.next) {
793
875
  case 0:
794
876
  if (!accepted) {
795
- _context7.next = 4;
877
+ _context8.next = 4;
796
878
  break;
797
879
  }
798
- _context7.next = 3;
880
+ _context8.next = 3;
799
881
  return deleteBasket(apiConfig, jwt, item.DivaNr, !trashed);
800
882
  case 3:
801
883
  deleteOne();
802
884
  case 4:
803
885
  case "end":
804
- return _context7.stop();
886
+ return _context8.stop();
805
887
  }
806
- }, _callee7);
888
+ }, _callee8);
807
889
  }));
808
- function callback(_x16) {
890
+ function callback(_x17) {
809
891
  return _callback3.apply(this, arguments);
810
892
  }
811
893
  return callback;
@@ -813,23 +895,23 @@ function deleteAction(_ref9) {
813
895
  });
814
896
  case 3:
815
897
  case "end":
816
- return _context8.stop();
898
+ return _context9.stop();
817
899
  }
818
- }, _callee8);
900
+ }, _callee9);
819
901
  }));
820
- return function (_x12, _x13, _x14, _x15) {
821
- return _ref10.apply(this, arguments);
902
+ return function (_x13, _x14, _x15, _x16) {
903
+ return _ref11.apply(this, arguments);
822
904
  };
823
905
  }();
824
906
  }
825
- function triggerSendEmail(_ref11) {
826
- var sendEmail = _ref11.sendEmail;
827
- _ref11.t;
828
- var action = _ref11.action;
829
- _ref11.organization;
830
- var user = _ref11.user,
831
- item = _ref11.item,
832
- callback = _ref11.callback;
907
+ function triggerSendEmail(_ref12) {
908
+ var sendEmail = _ref12.sendEmail;
909
+ _ref12.t;
910
+ var action = _ref12.action;
911
+ _ref12.organization;
912
+ var user = _ref12.user,
913
+ item = _ref12.item,
914
+ callback = _ref12.callback;
833
915
  var to;
834
916
  try {
835
917
  var _action$to;
@@ -883,17 +965,17 @@ function getMailAddress(string, required) {
883
965
  }
884
966
  throw new Error('Required mail address is missing');
885
967
  }
886
- function sendToIwofurn(_x17, _x18, _x19, _x20, _x21) {
968
+ function sendToIwofurn(_x18, _x19, _x20, _x21, _x22) {
887
969
  return _sendToIwofurn.apply(this, arguments);
888
970
  }
889
971
  function _sendToIwofurn() {
890
- _sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(apiConfig, jwt, divaNr, version, toggleLoading) {
972
+ _sendToIwofurn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(apiConfig, jwt, divaNr, version, toggleLoading) {
891
973
  var result;
892
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
893
- while (1) switch (_context9.prev = _context9.next) {
974
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
975
+ while (1) switch (_context10.prev = _context10.next) {
894
976
  case 0:
895
977
  toggleLoading('iwofurn');
896
- _context9.next = 3;
978
+ _context10.next = 3;
897
979
  return fetch("".concat(apiConfig.basketService, "/iwofurn/send?divaNr=").concat(divaNr, "&version=").concat(version), {
898
980
  method: 'POST',
899
981
  body: undefined,
@@ -905,38 +987,38 @@ function _sendToIwofurn() {
905
987
  return r.json();
906
988
  });
907
989
  case 3:
908
- result = _context9.sent;
990
+ result = _context10.sent;
909
991
  toggleLoading('iwofurn');
910
992
  if (!(result.result !== 'Success')) {
911
- _context9.next = 7;
993
+ _context10.next = 7;
912
994
  break;
913
995
  }
914
- return _context9.abrupt("return", result.error);
996
+ return _context10.abrupt("return", result.error);
915
997
  case 7:
916
- return _context9.abrupt("return", true);
998
+ return _context10.abrupt("return", true);
917
999
  case 8:
918
1000
  case "end":
919
- return _context9.stop();
1001
+ return _context10.stop();
920
1002
  }
921
- }, _callee9);
1003
+ }, _callee10);
922
1004
  }));
923
1005
  return _sendToIwofurn.apply(this, arguments);
924
1006
  }
925
- function setOrdered(_x22, _x23, _x24, _x25, _x26) {
1007
+ function setOrdered(_x23, _x24, _x25, _x26, _x27) {
926
1008
  return _setOrdered.apply(this, arguments);
927
1009
  }
928
1010
  function _setOrdered() {
929
- _setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(apiConfig, organizationId, jwt, divaNr, documentVersion) {
1011
+ _setOrdered = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(apiConfig, organizationId, jwt, divaNr, documentVersion) {
930
1012
  var body;
931
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
932
- while (1) switch (_context10.prev = _context10.next) {
1013
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
1014
+ while (1) switch (_context11.prev = _context11.next) {
933
1015
  case 0:
934
- _context10.prev = 0;
1016
+ _context11.prev = 0;
935
1017
  body = {
936
1018
  divaNr: divaNr,
937
1019
  version: documentVersion
938
1020
  };
939
- _context10.next = 4;
1021
+ _context11.next = 4;
940
1022
  return fetch("".concat(apiConfig.basketService, "/orders?organizationId=").concat(organizationId), {
941
1023
  method: 'POST',
942
1024
  headers: {
@@ -948,33 +1030,33 @@ function _setOrdered() {
948
1030
  return r.json();
949
1031
  });
950
1032
  case 4:
951
- _context10.next = 10;
1033
+ _context11.next = 10;
952
1034
  break;
953
1035
  case 6:
954
- _context10.prev = 6;
955
- _context10.t0 = _context10["catch"](0);
1036
+ _context11.prev = 6;
1037
+ _context11.t0 = _context11["catch"](0);
956
1038
  LOG.error(new DivaError('Could not set OrderStatus', {
957
- cause: _context10.t0
1039
+ cause: _context11.t0
958
1040
  }));
959
1041
  throw new Error('DivaNr not found');
960
1042
  case 10:
961
1043
  case "end":
962
- return _context10.stop();
1044
+ return _context11.stop();
963
1045
  }
964
- }, _callee10, null, [[0, 6]]);
1046
+ }, _callee11, null, [[0, 6]]);
965
1047
  }));
966
1048
  return _setOrdered.apply(this, arguments);
967
1049
  }
968
- function setArchived(_x27, _x28, _x29, _x30) {
1050
+ function setArchived(_x28, _x29, _x30, _x31) {
969
1051
  return _setArchived.apply(this, arguments);
970
1052
  }
971
1053
  function _setArchived() {
972
- _setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(apiConfig, jwt, divaNr, archived) {
1054
+ _setArchived = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(apiConfig, jwt, divaNr, archived) {
973
1055
  var result;
974
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
975
- while (1) switch (_context11.prev = _context11.next) {
1056
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1057
+ while (1) switch (_context12.prev = _context12.next) {
976
1058
  case 0:
977
- _context11.next = 2;
1059
+ _context12.next = 2;
978
1060
  return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr + (archived ? '/archive' : '/restore'), {
979
1061
  method: archived ? 'DELETE' : 'PATCH',
980
1062
  headers: {
@@ -985,32 +1067,32 @@ function _setArchived() {
985
1067
  return r.json();
986
1068
  });
987
1069
  case 2:
988
- result = _context11.sent;
1070
+ result = _context12.sent;
989
1071
  if (!result) {
990
- _context11.next = 5;
1072
+ _context12.next = 5;
991
1073
  break;
992
1074
  }
993
- return _context11.abrupt("return", result);
1075
+ return _context12.abrupt("return", result);
994
1076
  case 5:
995
1077
  throw new Error('DivaNr not found.');
996
1078
  case 6:
997
1079
  case "end":
998
- return _context11.stop();
1080
+ return _context12.stop();
999
1081
  }
1000
- }, _callee11);
1082
+ }, _callee12);
1001
1083
  }));
1002
1084
  return _setArchived.apply(this, arguments);
1003
1085
  }
1004
- function deleteBasket(_x31, _x32, _x33, _x34) {
1086
+ function deleteBasket(_x32, _x33, _x34, _x35) {
1005
1087
  return _deleteBasket.apply(this, arguments);
1006
1088
  }
1007
1089
  function _deleteBasket() {
1008
- _deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(apiConfig, jwt, divaNr, archived) {
1090
+ _deleteBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(apiConfig, jwt, divaNr, archived) {
1009
1091
  var result;
1010
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1011
- while (1) switch (_context12.prev = _context12.next) {
1092
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
1093
+ while (1) switch (_context13.prev = _context13.next) {
1012
1094
  case 0:
1013
- _context12.next = 2;
1095
+ _context13.next = 2;
1014
1096
  return fetch("".concat(apiConfig.basketService, "/baskets/") + divaNr, {
1015
1097
  method: 'DELETE',
1016
1098
  headers: {
@@ -1021,19 +1103,19 @@ function _deleteBasket() {
1021
1103
  return r.json();
1022
1104
  });
1023
1105
  case 2:
1024
- result = _context12.sent;
1106
+ result = _context13.sent;
1025
1107
  if (!result) {
1026
- _context12.next = 5;
1108
+ _context13.next = 5;
1027
1109
  break;
1028
1110
  }
1029
- return _context12.abrupt("return", result);
1111
+ return _context13.abrupt("return", result);
1030
1112
  case 5:
1031
1113
  throw new Error('DivaNr not found.');
1032
1114
  case 6:
1033
1115
  case "end":
1034
- return _context12.stop();
1116
+ return _context13.stop();
1035
1117
  }
1036
- }, _callee12);
1118
+ }, _callee13);
1037
1119
  }));
1038
1120
  return _deleteBasket.apply(this, arguments);
1039
1121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-archive",
3
- "version": "26.3.1-rc.0",
3
+ "version": "26.3.1",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,10 +15,10 @@
15
15
  "react-dom": "^18.3.1"
16
16
  },
17
17
  "dependencies": {
18
- "@crystaldesign/grid": "26.3.1-rc.0",
18
+ "@crystaldesign/grid": "26.3.1",
19
19
  "flat": "^5.0.2"
20
20
  },
21
21
  "module": "build/esm/index.js",
22
22
  "types": "./build/types/archive/src/index.d.ts",
23
- "gitHead": "d0e15e0535b55b33acfc9b3106a5fc3f6e06a3e8"
23
+ "gitHead": "79bd734619d751a75c1bc13c48d78cc530e7d37b"
24
24
  }