This commit is contained in:
Kirill
2026-05-26 12:10:38 +05:00
parent 4b8b86e1b8
commit e092299a11
37 changed files with 39573 additions and 214 deletions
+6 -1
View File
@@ -14,6 +14,7 @@ export async function registerCatalogSliderRoutes(fastify) {
id: s.id,
url: s.galleryImage.url,
caption: s.caption,
textColor: s.textColor,
})),
}
} catch (err) {
@@ -34,6 +35,7 @@ export async function registerCatalogSliderRoutes(fastify) {
galleryImageId: s.galleryImageId,
url: s.galleryImage.url,
caption: s.caption,
textColor: s.textColor,
})),
}
} catch (err) {
@@ -70,7 +72,8 @@ export async function registerCatalogSliderRoutes(fastify) {
return reply.code(400).send({ error: `Изображение не найдено: ${galleryImageId}` })
}
const caption = row?.caption == null ? '' : String(row.caption).slice(0, 500)
normalized.push({ galleryImageId, caption, sortOrder: i })
const textColor = String(row?.textColor || '#ffffff').trim()
normalized.push({ galleryImageId, caption, textColor, sortOrder: i })
}
await prisma.$transaction(async (tx) => {
@@ -80,6 +83,7 @@ export async function registerCatalogSliderRoutes(fastify) {
data: {
sortOrder: n.sortOrder,
caption: n.caption,
textColor: n.textColor,
galleryImageId: n.galleryImageId,
},
})
@@ -96,6 +100,7 @@ export async function registerCatalogSliderRoutes(fastify) {
galleryImageId: s.galleryImageId,
url: s.galleryImage.url,
caption: s.caption,
textColor: s.textColor,
})),
}
} catch (err) {