Actualiser js/admin.js
This commit is contained in:
+3
-1
@@ -312,14 +312,16 @@ function openAddModal() {
|
||||
}
|
||||
|
||||
function openEditModal(id) {
|
||||
const item = allItems.find(x => String(x.id) === String(id));
|
||||
const item = (dataStore[currentAdminTab] || []).find(x => String(x.id) === String(id));
|
||||
if (!item) return;
|
||||
|
||||
document.getElementById('f-id').value = item.id;
|
||||
document.getElementById('f-title').value = item.title;
|
||||
document.getElementById('f-year').value = item.year || '';
|
||||
document.getElementById('f-director').value = item.director || '';
|
||||
document.getElementById('f-poster').value = item.poster || '';
|
||||
toggleFormFields();
|
||||
|
||||
if (currentAdminTab === 'critique') {
|
||||
document.getElementById('f-rating').value = item.rating || 3;
|
||||
document.getElementById('f-review').value = item.review || '';
|
||||
|
||||
Reference in New Issue
Block a user