From 7ba006bea4971a116d737b8507a5107cb4187afa Mon Sep 17 00:00:00 2001 From: michellelin1 Date: Sun, 24 Mar 2024 14:49:10 -0700 Subject: [PATCH] edited catalog put request --- routes/catalog.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/catalog.js b/routes/catalog.js index d7ef126..0c0bc94 100644 --- a/routes/catalog.js +++ b/routes/catalog.js @@ -115,12 +115,12 @@ catalogRouter.put('/:id', async (req, res) => { `UPDATE catalog SET ${host ? 'host = $(host), ' : ''} ${title ? 'title = $(title),' : ''} - ${eventType ? 'event_type = $(eventType), ' : ''} - ${subject ? 'subject = $(subject), ' : ''} + ${eventType ? 'event_type = $(eventType)::event[], ' : ''} + ${subject ? 'subject = $(subject)::subject[], ' : ''} ${description ? 'description = $(description), ' : ''} - ${year ? 'year = $(year), ' : ''} + ${year ? 'year = $(year)::year[], ' : ''} ${location ? 'location = $(location), ' : ''} - ${season ? 'season = $(season), ' : ''} + ${season ? 'season = $(season)::season[], ' : ''} id = '${id}' WHERE id = '${id}' RETURNING *;`,