From f2c2bbaae96e54c4ac3e5618fa8a3a7ba177cf79 Mon Sep 17 00:00:00 2001 From: johan Date: Tue, 10 Jan 2023 08:58:05 +0100 Subject: [PATCH] ca --- static/js/main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/main.js b/static/js/main.js index 9fdb06c..73cda54 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -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(),