Skip to content

Commit 89b68c8

Browse files
committed
update to use new axiosPost func
1 parent 5580842 commit 89b68c8

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

photon-client/src/components/cameras/CameraCalibrationInfoCard.vue

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ import type { CameraCalibrationResult, VideoFormat } from "@/types/SettingTypes"
33
import { useCameraSettingsStore } from "@/stores/settings/CameraSettingsStore";
44
import { useStateStore } from "@/stores/StateStore";
55
import { computed, inject, ref } from "vue";
6-
import { getResolutionString, parseJsonFile } from "@/lib/PhotonUtils";
6+
import { axiosPost, getResolutionString, parseJsonFile } from "@/lib/PhotonUtils";
77
import { useTheme } from "vuetify";
8-
import axios from "axios";
98
109
const theme = useTheme();
1110
@@ -14,36 +13,11 @@ const props = defineProps<{
1413
}>();
1514
1615
const removeCalibration = () => {
17-
axios
18-
.post("/calibration/remove", {
19-
cameraUniqueName: useCameraSettingsStore().currentCameraSettings.uniqueName,
20-
width: props.videoFormat.resolution.width,
21-
height: props.videoFormat.resolution.height
22-
})
23-
.then((response) => {
24-
useStateStore().showSnackbarMessage({
25-
message: response.data.text || response.data,
26-
color: "success"
27-
});
28-
})
29-
.catch((error) => {
30-
if (error.response) {
31-
useStateStore().showSnackbarMessage({
32-
color: "error",
33-
message: error.response.data.text || error.response.data
34-
});
35-
} else if (error.request) {
36-
useStateStore().showSnackbarMessage({
37-
color: "error",
38-
message: "Error while trying to process the request! The backend didn't respond."
39-
});
40-
} else {
41-
useStateStore().showSnackbarMessage({
42-
color: "error",
43-
message: "An error occurred while trying to process the request."
44-
});
45-
}
46-
});
16+
axiosPost("/calibration/remove", "delete a camera calibration", {
17+
cameraUniqueName: useCameraSettingsStore().currentCameraSettings.uniqueName,
18+
width: props.videoFormat.resolution.width,
19+
height: props.videoFormat.resolution.height
20+
});
4721
};
4822
4923
const exportCalibration = ref();

0 commit comments

Comments
 (0)