thm-p3-configurator 0.0.165 → 0.0.166
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);
|