Skip to content

Commit

Permalink
duties is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
adRn-s committed Nov 20, 2023
1 parent fd7dd5f commit c9b78b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/views/dutiesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ var axiosRef = axios.create({
},
});
let urlPart = window.location.href.split("/vue/");
export default {
name: "Duties",
components: {
Expand Down Expand Up @@ -302,7 +304,6 @@ export default {
},
async saveDuty() {
this.gridOptions.api.showLoadingOverlay();
let slices = window.location.href.split("/vue/");
let newDuty = toRaw(this.newDuty);
if (
!newDuty.main_name ||
Expand All @@ -318,7 +319,7 @@ export default {
this.gridOptions.api.hideOverlay();
} else {
await axiosRef
.post(slices[0] + "/api/duties/", newDuty)
.post(urlPart[0] + "/api/duties/", newDuty)
.then(() => {
this.newDuty = {};
document.getElementById("facility").value = "";
Expand All @@ -342,10 +343,9 @@ export default {
}
},
async getDuties(refresh = false, additionalUrl = "") {
let slices = window.location.href.split("/vue/");
try {
const response = await axiosRef.get(
slices[0] + "/api/duties/" +
urlPart[0] + "/api/duties/" +
(additionalUrl !== "" ? "?" + additionalUrl : "")
);
let fetchedRows = [];
Expand Down Expand Up @@ -483,7 +483,7 @@ export default {
break;
}
await axiosRef
.patch("http://localhost:9980/api/duties/" + String(dutyId) + "/", {
.patch(urlPart[0] + "/api/duties/" + String(dutyId) + "/", {
[columnName]: newValue,
})
.then(() => {
Expand Down

0 comments on commit c9b78b6

Please sign in to comment.