bla
This commit is contained in:
parent
bcd5da4adb
commit
9dc2c1a7ed
1 changed files with 9 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue