From 956b570f67d737cd37af7cdd97da21309f742988 Mon Sep 17 00:00:00 2001 From: asyncnomi Date: Mon, 9 Jan 2023 10:38:50 +0100 Subject: [PATCH 1/2] bla --- static/js/main.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index dd6cfb4..88fb4c3 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -289,7 +289,7 @@ function get_admin(type) { } activityData.sort((a, b) => new Date(a.start) - new Date(b.start)); for (entry in activityData) { - if (activityData[entry].type = "event") { + if (activityData[entry].type == "event") { $("#admin-content").append(`
Event:
@@ -306,7 +306,7 @@ function get_admin(type) {
`) - } else if (activityData[entry].type = "treasure") { + } else if (activityData[entry].type == "treasure") { $("#admin-content").prepend(`
Trésor:
@@ -631,7 +631,7 @@ $('#treasure-popup-button').click((e) => { var tuid = $('#treasure-popup-uid').val(); if(tuid != '') { indata.treasureUid = tuid; - } + } fr.addEventListener('load', () => { indata.image = fr.result; @@ -641,7 +641,7 @@ $('#treasure-popup-button').click((e) => { data: JSON.stringify(indata), contentType: "application/json; charset=utf-8", dataType: "json", - + success: function(data) { if(data.success) { updateDemandes(); @@ -653,7 +653,7 @@ $('#treasure-popup-button').click((e) => { }); }); - + fr.readAsDataURL(f); }); @@ -816,7 +816,7 @@ function updateDemandes() { $elem = $('#' + td[td_uid].activityUid); $elem.addClass('treasure-submitted'); $elem.find(".treasure-btn-submit").text('Editer la soumission'); - + $(`
Image: Lien
`).insertAfter($elem.find('.treasure-desc')) $(`
${td[td_uid].desc}
`).insertAfter($elem.find('.treasure-desc')) $(`

Votre soumission :

`).insertAfter($elem.find('.treasure-desc')) @@ -831,7 +831,7 @@ function updateDemandes() { console.error(data.why); } } - + }); } } From 6c7d0801c2b1f1a3746751f444f30d8eda6ba3d9 Mon Sep 17 00:00:00 2001 From: asyncnomi Date: Mon, 9 Jan 2023 11:05:28 +0100 Subject: [PATCH 2/2] bla --- index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index bfc9436..6b42c4f 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,4 @@ -const fastify = require('fastify')({ - logger: true, - bodyLimit: 10485760 -}) +const fastify = require('fastify')({ logger: true }) const fs = require('fs'); const path = require('path') const CryptoJS = require("crypto-js"); @@ -28,7 +25,8 @@ let MaxAmountCrepe = 10; let Supplements = ["nature", "sucre", "nutella", "confiture"]; fastify.addContentTypeParser('application/json', { - parseAs: 'string' + parseAs: 'string', + bodyLimit: 10485760 }, function(req, body, done) { try { var json = JSON.parse(body)