Songs & dates
This commit is contained in:
@@ -8,9 +8,11 @@ export interface Sermon {
|
||||
slug: string
|
||||
title: string
|
||||
date: string
|
||||
dates?: string
|
||||
bible_references: string
|
||||
personal_appliance: string
|
||||
pastors_challenge: string
|
||||
worship_songs?: string
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
@@ -32,9 +34,11 @@ export function getDatabase() {
|
||||
slug TEXT UNIQUE NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
date TEXT NOT NULL,
|
||||
dates TEXT,
|
||||
bible_references TEXT NOT NULL,
|
||||
personal_appliance TEXT NOT NULL,
|
||||
pastors_challenge TEXT NOT NULL,
|
||||
worship_songs TEXT,
|
||||
archived INTEGER DEFAULT 0,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
@@ -87,16 +91,18 @@ export function getSermonBySlug(slug: string) {
|
||||
export function createSermon(sermon: Sermon) {
|
||||
const db = getDatabase()
|
||||
const stmt = db.prepare(`
|
||||
INSERT INTO sermons (slug, title, date, bible_references, personal_appliance, pastors_challenge)
|
||||
VALUES (?, ?, ?, ?, ?, ?)
|
||||
INSERT INTO sermons (slug, title, date, dates, bible_references, personal_appliance, pastors_challenge, worship_songs)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`)
|
||||
return stmt.run(
|
||||
sermon.slug,
|
||||
sermon.title,
|
||||
sermon.date,
|
||||
sermon.dates || null,
|
||||
sermon.bible_references,
|
||||
sermon.personal_appliance,
|
||||
sermon.pastors_challenge
|
||||
sermon.pastors_challenge,
|
||||
sermon.worship_songs || null
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user