chore(webui): say "successfully removed" when using a negative quantity (#1271)
All checks were successful
Build / build (18) (push) Successful in 1m9s
Build / build (20) (push) Successful in 41s
Build Docker image / docker (push) Successful in 32s
Build / build (22) (push) Successful in 1m12s

Reviewed-on: #1271
This commit is contained in:
Sainan 2025-03-22 03:37:06 -07:00
parent 468ede680a
commit beb02bffb0
2 changed files with 20 additions and 12 deletions

View File

@ -812,20 +812,27 @@ function doAcquireMiscItems() {
$("#miscitem-type").addClass("is-invalid").focus();
return;
}
revalidateAuthz(() => {
$.post({
url: "/custom/addItems?" + window.authz,
contentType: "application/json",
data: JSON.stringify([
{
ItemType: uniqueName,
ItemCount: parseInt($("#miscitem-count").val())
const count = parseInt($("#miscitem-count").val());
if (count != 0) {
revalidateAuthz(() => {
$.post({
url: "/custom/addItems?" + window.authz,
contentType: "application/json",
data: JSON.stringify([
{
ItemType: uniqueName,
ItemCount: count
}
])
}).done(function () {
if (count > 0) {
toast(loc("code_succAdded"));
} else {
toast(loc("code_succRemoved"));
}
])
}).done(function () {
toast(loc("code_succAdded"));
});
});
});
}
}
function doAcquireRiven() {

View File

@ -28,6 +28,7 @@ dict = {
code_succRankUp: `Successfully ranked up.`,
code_noEquipmentToRankUp: `No equipment to rank up.`,
code_succAdded: `Successfully added.`,
code_succRemoved: `Successfully removed.`,
code_buffsNumber: `Number of buffs`,
code_cursesNumber: `Number of curses`,
code_rerollsNumber: `Number of rerolls`,