Bug 40567: Correct eslint errors in recalls.js

This patch corrects a few minor errors in recalls.js. There should be no
change to how the pages work.

The following functions have been changed:

- Cancel a recall from the recalls tab on a patron record
- Expire a recall or revert the waiting status of a recall from the
  "Recalls awaiting pickup" page.
- Cancel a recall which has been transferred from the "Recalls queue"
  page.
- Mark a recall "Overdue" from the "Recalls queue" page.
- Cancel selected recalls on the "Recalls queue" page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 971028cf3a)
Signed-off-by: Jacob O'Mara <jacob.omara@openfifth.co.uk>
This commit is contained in:
Owen Leonard 2025-07-31 15:21:04 +00:00 committed by Jacob O'Mara
parent f331ff3419
commit b6fbded69a
No known key found for this signature in database
1 changed files with 12 additions and 6 deletions

View File

@ -1,10 +1,12 @@
/* global APIClient __ confirmDelete */
$(document).ready(function () {
const client = APIClient.recall;
$(".cancel_recall").click(function (e) {
$(".cancel_recall").click(function () {
if (confirmDelete(__("Are you sure you want to remove this recall?"))) {
let td_node = $(this).parents("td");
let recall_id = $(this).data("id");
let message;
client.recalls.cancel(recall_id).then(
success => {
if (success.success == 0) {
@ -23,10 +25,11 @@ $(document).ready(function () {
}
});
$(".expire_recall").click(function (e) {
$(".expire_recall").click(function () {
if (confirmDelete(__("Are you sure you want to expire this recall?"))) {
let td_node = $(this).parents("td");
let recall_id = $(this).data("id");
let message;
client.recalls.expire(recall_id).then(
success => {
if (success.success == 0) {
@ -45,7 +48,7 @@ $(document).ready(function () {
}
});
$(".revert_recall").click(function (e) {
$(".revert_recall").click(function () {
if (
confirmDelete(
__(
@ -55,6 +58,7 @@ $(document).ready(function () {
) {
let td_node = $(this).parents("td");
let recall_id = $(this).data("id");
let message;
client.recalls.revert(recall_id).then(
success => {
if (success.success == 0) {
@ -73,7 +77,7 @@ $(document).ready(function () {
}
});
$(".overdue_recall").click(function (e) {
$(".overdue_recall").click(function () {
if (
confirmDelete(
__("Are you sure you want to mark this recall as overdue?")
@ -81,6 +85,7 @@ $(document).ready(function () {
) {
let td_node = $(this).parents("td");
let recall_id = $(this).data("id");
let message;
client.recalls.overdue(recall_id).then(
success => {
if (success.success == 0) {
@ -99,7 +104,7 @@ $(document).ready(function () {
}
});
$(".transit_recall").click(function (e) {
$(".transit_recall").click(function () {
if (
confirmDelete(
__(
@ -109,6 +114,7 @@ $(document).ready(function () {
) {
let td_node = $(this).parents("td");
let recall_id = $(this).data("id");
let message;
client.recalls.transit(recall_id).then(
success => {
if (success.success == 0) {
@ -132,7 +138,7 @@ $(document).ready(function () {
pagingType: "full_numbers",
});
$("#cancel_selected").click(function (e) {
$("#cancel_selected").click(function () {
if ($("input[name='recall_ids']:checked").length > 0) {
return confirmDelete(
__("Are you sure you want to remove the selected recall(s)?")