thm-p3-configurator 0.0.165 → 0.0.167

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.
@@ -12,6 +12,7 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _mutations = require("../../__api__/mutations");
13
13
  var _Header = _interopRequireDefault(require("../../__components__/Header"));
14
14
  var _NavigationSteps = _interopRequireDefault(require("../../__components__/NavigationSteps"));
15
+ var _reactQuery = require("react-query");
15
16
  var _constants__ = require("../../__constants__");
16
17
  var _internal = require("../../__containers__/internal");
17
18
  var _InternalAppointmentForm = _interopRequireDefault(require("../../__containers__/internal/InternalAppointmentForm"));
@@ -29,6 +30,7 @@ const InternalAppointmentPage = () => {
29
30
  const [{
30
31
  existingDossierId
31
32
  }] = (0, _OrderSessionContext.useOrderSession)();
33
+ const queryClient = (0, _reactQuery.useQueryClient)();
32
34
  const {
33
35
  createPlannedAppointment,
34
36
  isCreatePlannedAppointmentError,
@@ -57,12 +59,14 @@ const InternalAppointmentPage = () => {
57
59
  if (payload !== null && payload !== void 0 && payload.appointmentType && payload.appointmentType === _constants__.DOSSIER_TYPES.PlannedAppointment) {
58
60
  if (existingDossierId) {
59
61
  await updateAppointment(payload);
62
+ queryClient.invalidateQueries([_constants__.DOSSIER_TYPES.PlannedAppointment, existingDossierId]);
60
63
  return;
61
64
  }
62
65
  await createPlannedAppointment(payload);
63
66
  } else {
64
67
  if (existingDossierId) {
65
68
  await updateAppointmentRequest(payload);
69
+ queryClient.invalidateQueries([_constants__.DOSSIER_TYPES.AppointmentRequest, existingDossierId]);
66
70
  return;
67
71
  }
68
72
  await createAppointmentRequest(payload);
@@ -35,6 +35,7 @@ var _helpers__ = require("../../__helpers__");
35
35
  var _dossier = require("../../__helpers__/dossier");
36
36
  var _useSearchParam = _interopRequireDefault(require("../../__hooks__/useSearchParam"));
37
37
  var _authenticatedProxyApi = require("../../__api__/authenticatedProxyApi");
38
+ var _reactQuery = require("react-query");
38
39
  function _interopRequireDefault(e) {
39
40
  return e && e.__esModule ? e : {
40
41
  default: e
@@ -109,15 +110,18 @@ function _toPrimitive(t, r) {
109
110
  return ("string" === r ? String : Number)(t);
110
111
  }
111
112
  const InternalSessionEditPage = props => {
112
- var _props$match;
113
+ var _props$match, _props$match2, _props$match3;
113
114
  const [dossierType] = (0, _useSearchParam.default)(['dossierType']); // Note: this is of type `DOSSIER_TYPES` (found in __constants__ folder)
114
115
 
116
+ const queryClient = (0, _reactQuery.useQueryClient)();
115
117
  const formula = (0, _FormulaContext.useFormula)();
118
+ queryClient.invalidateQueries([dossierType, props === null || props === void 0 || (_props$match = props.match) === null || _props$match === void 0 || (_props$match = _props$match.params) === null || _props$match === void 0 ? void 0 : _props$match.id]);
119
+ console.log([dossierType, props === null || props === void 0 || (_props$match2 = props.match) === null || _props$match2 === void 0 || (_props$match2 = _props$match2.params) === null || _props$match2 === void 0 ? void 0 : _props$match2.id]);
116
120
  const {
117
121
  dossierById,
118
122
  isDossierByIdError
119
123
  } = (0, _queries.usePrivateDossierByTypeAndIdQuery)({
120
- dossierId: props === null || props === void 0 || (_props$match = props.match) === null || _props$match === void 0 || (_props$match = _props$match.params) === null || _props$match === void 0 ? void 0 : _props$match.id,
124
+ dossierId: props === null || props === void 0 || (_props$match3 = props.match) === null || _props$match3 === void 0 || (_props$match3 = _props$match3.params) === null || _props$match3 === void 0 ? void 0 : _props$match3.id,
121
125
  dossierType: dossierType
122
126
  });
123
127
  const [_, dispatch] = (0, _OrderSessionContext.useOrderSession)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.165",
3
+ "version": "0.0.167",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",