Skip to content

Commit

Permalink
fix javascript calls to delete routes which currently don't work
Browse files Browse the repository at this point in the history
  • Loading branch information
DAcodedBEAT committed Dec 31, 2023
1 parent 42ac712 commit 7884a00
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions react/components/Events/ExistingEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,11 @@ class ExistingEvent extends React.Component<EventFormProps, EventFormState> {
delete() {
fetch(CRMRoot + "/api/events/" + this.props.eventId, {
credentials: "include",
method: "POST",
method: "DELETE",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({ _METHOD: "DELETE" }),
}).then(() => this.exit());
}

Expand Down
4 changes: 2 additions & 2 deletions src/skin/js/CRMJSOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ window.CRM.cart = {
},
removePerson: function (Persons, callback) {
window.CRM.APIRequest({
method: "POST",
method: "DELETE",
path: "cart/",
data: JSON.stringify({ _METHOD: "DELETE", Persons: Persons }),
data: JSON.stringify({ Persons: Persons }),
}).done(function (data) {
window.CRM.cart.refresh();
if (callback) {
Expand Down
5 changes: 1 addition & 4 deletions src/skin/js/FamilyView.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,14 @@ $(document).ready(function () {

$("#deletePhoto").click(function () {
$.ajax({
type: "POST",
type: "DELETE",
url:
window.CRM.root +
"/api/family/" +
window.CRM.currentFamily +
"/photo",
encode: true,
dataType: "json",
data: {
_METHOD: "DELETE",
},
}).done(function (data) {
location.reload();
});
Expand Down
3 changes: 1 addition & 2 deletions src/skin/js/GroupEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ $("document").ready(function () {
$(document).on("click", ".deleteRole", function (e) {
var roleID = e.currentTarget.id.split("-")[1];
$.ajax({
method: "POST",
method: "DELETE",
url:
window.CRM.root + "/api/groups/" + groupID + "/roles/" + roleID,
encode: true,
data: { _METHOD: "DELETE" },
dataType: "json",
}).done(function (data) {
dataT.clear();
Expand Down
1 change: 0 additions & 1 deletion src/skin/js/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function deleteUser(userId, userName) {
window.CRM.APIRequest({
method: "DELETE",
path: "user/" + userId + "/",
data: { _METHOD: "DELETE" },
}).done(function () {
window.location.href = window.CRM.root + "/UserList.php";
});
Expand Down
2 changes: 1 addition & 1 deletion src/v2/templates/cart/cartlisting.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</td>
<td><?= $Person->getAddress() ?></td>
<td><?= $Person->getEmail() ?></td>
<td><a class="RemoveFromPeopleCart" data-personid="<?= $Person->getId() ?>"><?= gettext('Remove') ?></a>
<td><button class="RemoveFromPeopleCart" data-personid="<?= $Person->getId() ?>"><?= gettext('Remove') ?></button>
</td>
<td><?= $Person->getClassificationName() ?></td>
<td><?= $Person->getFamilyRoleName() ?></td>
Expand Down

0 comments on commit 7884a00

Please sign in to comment.