mirror of
https://github.com/clucraft/PriceGhost.git
synced 2026-06-08 15:05:16 +02:00
Truncate product name to 255 chars before DB insert
Prevents Postgres VARCHAR(255) overflow error when scraping pages with long product titles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
33b944588d
commit
bdc87cad86
1 changed files with 2 additions and 2 deletions
|
|
@ -48,7 +48,7 @@ router.post('/', async (req: AuthRequest, res: Response) => {
|
|||
const product = await productQueries.create(
|
||||
userId,
|
||||
url,
|
||||
scrapedData.name,
|
||||
scrapedData.name?.substring(0, 255) ?? null,
|
||||
scrapedData.imageUrl,
|
||||
refresh_interval || 3600,
|
||||
scrapedData.stockStatus
|
||||
|
|
@ -133,7 +133,7 @@ router.post('/', async (req: AuthRequest, res: Response) => {
|
|||
const product = await productQueries.create(
|
||||
userId,
|
||||
url,
|
||||
scrapedData.name,
|
||||
scrapedData.name?.substring(0, 255) ?? null,
|
||||
scrapedData.imageUrl,
|
||||
refresh_interval || 3600,
|
||||
scrapedData.stockStatus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue