This commit is contained in:
asyncnomi 2023-01-08 22:53:50 +01:00
parent bcd5da4adb
commit 9dc2c1a7ed

View file

@ -614,7 +614,13 @@ function updateDemandes() {
success: function (data) {
if(data.success) {
$('#demande-list').html('');
let pd = data.prankData;
let pd = [];
for (pd_uid in data.prankData) {
if (data.prankData[pd_uid].creator == localStorage.getItem('user')) {
pd.push(data.prankData[pd_uid]);
}
}
pd.sort((a, b) => new Date(b.date) - new Date(a.date));
for(const pd_uid in pd) {
$('#demande-list').append(`
<span id="${pd_uid}" class="prank">
@ -626,7 +632,7 @@ function updateDemandes() {
<div class="prank-status">Statue: ${pd[pd_uid].state}</div>
${ (pd[pd_uid].state != "Accepted" && pd[pd_uid].state != "Refused" ) ?
`<span class="activity-btn">
<div class="prank-btn-delete">Supprimer</div>
<div class="prank-btn-delete">Annuler</div>
</span>`
: ''
}
@ -651,7 +657,7 @@ function updateDemandes() {
updateDemandes();
}
else {
alter(data.why);
alert(data.why);
}
}