Logo swap, layour changes so the night mode button stays on top. Change src images to Image from next otherwise lint will complain. Api changes to accomendate the new Strapi. Same for type changes to fit into the new Strapi.

This commit is contained in:
2025-01-12 04:12:17 -05:00
parent 3fed14c353
commit 7a0ec01a39
11 changed files with 109 additions and 90 deletions

View File

@@ -50,8 +50,8 @@ export async function fetchBooks(): Promise<Book[]> {
}
export async function fetchBookChapterLinks(bookId: string): Promise<Book> {
const currentDate = new Date().toISOString().split("T")[0];
const data = await fetchFromAPI<{ data: Book }>(`/api/books/${bookId}?populate[chapters][filters][ReleaseDate][$lte]=${currentDate}`);
const currentDateTime = new Date().toISOString();
const data = await fetchFromAPI<{ data: Book }>(`/api/books/${bookId}?populate[chapters][filters][release_datetime][$lte]=${currentDateTime}`);
return data.data
}
@@ -60,9 +60,9 @@ export async function fetchBookChapterLinks(bookId: string): Promise<Book> {
* Filters chapters by release date to include only valid ones.
*/
export async function fetchBookById(bookId: string): Promise<Book> {
const currentDate = new Date().toISOString().split("T")[0];
const currentDateTime = new Date().toISOString();
const data = await fetchFromAPI<{ data: Book }>(
`/api/books/${bookId}?populate[chapters][filters][ReleaseDate][$lte]=${currentDate}`
`/api/books/${bookId}?populate[chapters][filters][release_datetime][$lte]=${currentDateTime}&populate=cover`
);
return data.data;
}

View File

@@ -2,10 +2,11 @@
export interface Chapter {
id: number;
documentId: string;
Name: string;
Chapter_Number: number;
ReleaseDate: string;
Content: string;
number: number;
title: string;
editor?: Editor;
release_date: string;
content: string;
book?: Book;
}
@@ -13,13 +14,14 @@ export interface Editor {
id: number;
name: string;
email: string;
books: Book[];
discord: string;
chapters: Chapter[];
}
export interface Glossary {
id: number;
name: string;
entries: string[];
chinese_english: JSON;
english_english: JSON;
}
export interface Media {
@@ -50,16 +52,18 @@ export interface Media {
export interface Book {
id: number;
documentId: string;
Name: string;
ReleaseDate: string;
title: string;
raw_title: string;
author: string;
raw_author: string;
cover: Media[] | null;
description: string;
release_date: string;
chapters: Chapter[];
Cover: Media | null;
Author: string;
Complete: boolean;
editors: Editor[];
RawName: string;
RawAuthor: string;
glossary: Glossary;
Description: string;
}
export const Ad = {
patreon: "https://patreon.com/nulltranslationgroup",
}