Fixed chapter counting and numbering issues

- Updated API functions to accept version parameter (getBook, getChapter)
- Added proper chapter sorting with parseInt for numerical order
- Removed fallback to 50 fake chapters - now shows actual chapter counts
- Fixed Psalms chapter numbering: 1,2,3,4,5,6,7,8,9,10,11,12... instead of 1,2,3,4,5,6,7,8,9,10,101,102...
- Books like 2 John now show correct number of chapters (1) instead of fake 50
This commit is contained in:
Ryderjj89
2025-09-28 17:58:47 -04:00
parent 8cb2aeef4b
commit 537898b4d0
5 changed files with 13 additions and 13 deletions

View File

@@ -18,13 +18,13 @@ export const getBooks = async (): Promise<BookData> => {
return response.data;
};
export const getBook = async (book: string): Promise<{ chapters: string[] }> => {
const response = await api.get(`/books/${book}`);
export const getBook = async (book: string, version: string = 'esv'): Promise<{ chapters: string[] }> => {
const response = await api.get(`/books/${book}?version=${version}`);
return response.data;
};
export const getChapter = async (book: string, chapter: string): Promise<string> => {
const response = await api.get(`/books/${book}/${chapter}`);
export const getChapter = async (book: string, chapter: string, version: string = 'esv'): Promise<string> => {
const response = await api.get(`/books/${book}/${chapter}?version=${version}`);
return response.data;
};