fix(student): не дублировать главное фото записи/ученика в галерее

This commit is contained in:
dev
2026-10-12 01:34:33 +03:00
parent 0f85ce2773
commit e4f23d4756
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -148,7 +148,7 @@
const items = data.entries.items;
if (!items.length) return emptyHtml('Записей в журнале пока нет');
return `<div class="sp-list">${items.map(e => {
const photos = (e.photos || []).map(p => photoTile(p.photo_path));
const photos = (e.photos || []).filter(p => p.photo_path !== e.photo_path).map(p => photoTile(p.photo_path));
if (e.photo_path) photos.unshift(photoTile(e.photo_path, null, e.photo_original_path));
return `<div class="lesson-item">
<div class="lesson-item-head">
@@ -193,7 +193,7 @@
function photosHtml() {
const main = data.photos.photo_path;
const items = data.photos.items || [];
const items = (data.photos.items || []).filter(p => p.photo_path !== main);
if (!main && !items.length) return emptyHtml('Фотографий нет');
const tiles = [];
if (main) tiles.push(photoTile(main, 'sp-photo'));