mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-02-04 10:54:44 -05:00
switched to NKJV, improved grading, improved styling
This commit is contained in:
25
src/routes/random/+page.server.ts
Normal file
25
src/routes/random/+page.server.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { fetchRandomVerse } from '$lib/server/bible-api';
|
||||
import { getBookById } from '$lib/server/bible';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const apiVerse = await fetchRandomVerse();
|
||||
|
||||
// Create a dailyVerse-like object for VerseDisplay
|
||||
const dailyVerse = {
|
||||
id: 'debug-' + Date.now(),
|
||||
date: new Date().toLocaleDateString('en-CA', { timeZone: 'America/New_York' }),
|
||||
bookId: apiVerse.bookId,
|
||||
reference: apiVerse.reference,
|
||||
verseText: apiVerse.verseText,
|
||||
createdAt: new Date()
|
||||
};
|
||||
|
||||
const correctBook = getBookById(dailyVerse.bookId) ?? null;
|
||||
|
||||
return {
|
||||
dailyVerse,
|
||||
correctBookId: dailyVerse.bookId,
|
||||
correctBook
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user