Merge branch 'master' of git.rezo-rm.fr:BDEMetz/bde-liste

This commit is contained in:
asyncnomi 2023-01-10 09:18:00 +01:00
commit 307a16d25d
2 changed files with 13 additions and 2 deletions

View file

@ -153,7 +153,7 @@
<input type="text" class="form-control" placeholder="Lieu de livraison" id="demande-where">
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="Quantité" max="8" id="demande-amount">
<input type="number" class="form-control" placeholder="Quantité" max="9" id="demande-amount">
</div>
<div class="form-group">
<select class="form-control" id="demande-supp">

View file

@ -670,6 +670,16 @@ $('#treasure-popup-button').click((e) => {
});
$('#demande-button').click(function () {
amount = $('#demande-amount').val();
if (amount > 9) {
t = new TypeIt('#error-message-demande', {
speed: 100,
lifeLike: true
})
.type("Trop de crêpes, maximum c'est 9")
.go();
return;
}
$.ajax({
type: "POST",
url: base_url + "addPrank",
@ -677,7 +687,7 @@ $('#demande-button').click(function () {
uid: localStorage.getItem('user'),
token: localStorage.getItem('token'),
type: "crêpe",
amount: $('#demande-amount').val(),
amount: amount,
where: $('#demande-where').val(),
supplement: $('#demande-supp').val(),
note: $('#demande-notes').val(),
@ -688,6 +698,7 @@ $('#demande-button').click(function () {
success: function(data) {
if(data.success) {
$('#demande-form input').val("");
alert("C'est envoyé, gros gourmand ^^")
updateDemandes();
} else {
$('#error-message-demande').empty();