ыввы
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user