Songs & dates
This commit is contained in:
@@ -20,7 +20,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
const body = await readBody(event)
|
||||
const { slug, title, date, bible_references, personal_appliance, pastors_challenge } = body
|
||||
const { slug, title, date, dates, bible_references, personal_appliance, pastors_challenge, worship_songs } = body
|
||||
|
||||
if (!slug || !title || !date || !bible_references || !personal_appliance || !pastors_challenge) {
|
||||
throw createError({
|
||||
@@ -33,10 +33,10 @@ export default defineEventHandler(async (event) => {
|
||||
const db = getDatabase()
|
||||
const result = db.prepare(`
|
||||
UPDATE sermons
|
||||
SET slug = ?, title = ?, date = ?, bible_references = ?,
|
||||
personal_appliance = ?, pastors_challenge = ?
|
||||
SET slug = ?, title = ?, date = ?, dates = ?, bible_references = ?,
|
||||
personal_appliance = ?, pastors_challenge = ?, worship_songs = ?
|
||||
WHERE id = ?
|
||||
`).run(slug, title, date, bible_references, personal_appliance, pastors_challenge, parseInt(id))
|
||||
`).run(slug, title, date, dates || null, bible_references, personal_appliance, pastors_challenge, worship_songs || null, parseInt(id))
|
||||
|
||||
if (result.changes === 0) {
|
||||
throw createError({
|
||||
|
||||
Reference in New Issue
Block a user