Introduce series management functionality and repository updates
- Added `series-world.repo.ts` to handle database operations related to series worlds and their elements. - Implemented `series-sync.repo.ts` for managing synchronization between books and series. - Expanded `spell.ipc.ts` data models to include `seriesSpellId` for spell synchronization. - Refactored `insertSpellTag` method in `spelltag.repo.ts` for improved error handling and logic clarity.
This commit is contained in:
@@ -63,8 +63,7 @@ export default class ChapterContentRepository {
|
||||
LIMIT 1
|
||||
`;
|
||||
const params: SQLiteValue[] = [userId, bookId];
|
||||
const chapterContents: ChapterContentQueryResult[] = db.all(query, params) as ChapterContentQueryResult[];
|
||||
return chapterContents;
|
||||
return db.all(query, params) as ChapterContentQueryResult[];
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
console.error(`DB Error: ${error.message}`);
|
||||
@@ -127,8 +126,7 @@ export default class ChapterContentRepository {
|
||||
const db: Database = System.getDb();
|
||||
const query: string = 'SELECT version, content, words_count FROM book_chapter_content WHERE author_id=? AND chapter_id=? AND version=?';
|
||||
const params: SQLiteValue[] = [userId, chapterId, version];
|
||||
const companionContents: CompanionContentQueryResult[] = db.all(query, params) as CompanionContentQueryResult[];
|
||||
return companionContents;
|
||||
return db.all(query, params) as CompanionContentQueryResult[];
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof Error) {
|
||||
console.error(`DB Error: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user