diff --git a/src/routes/likernft/book/store.ts b/src/routes/likernft/book/store.ts index e427bb7b1..d466e1549 100644 --- a/src/routes/likernft/book/store.ts +++ b/src/routes/likernft/book/store.ts @@ -419,6 +419,7 @@ router.post(['/:classId/new', '/class/:classId/new'], jwtAuth('write:nftbook'), mustClaimToView = false, hideDownload = false, enableCustomMessagePage = false, + tableOfContents, autoDeliverNFTsTxHash, } = req.body; const [iscnInfo, metadata] = await Promise.all([ @@ -479,6 +480,7 @@ router.post(['/:classId/new', '/class/:classId/new'], jwtAuth('write:nftbook'), shippingRates, mustClaimToView, enableCustomMessagePage, + tableOfContents, hideDownload, // From ISCN content metadata @@ -532,6 +534,7 @@ router.post(['/:classId/new', '/class/:classId/new'], jwtAuth('write:nftbook'), mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, }); res.json({ @@ -553,6 +556,7 @@ router.post(['/:classId/settings', '/class/:classId/settings'], jwtAuth('write:n mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, } = req.body; const bookInfo = await getNftBookInfo(classId); if (!bookInfo) throw new ValidationError('CLASS_ID_NOT_FOUND', 404); @@ -569,6 +573,7 @@ router.post(['/:classId/settings', '/class/:classId/settings'], jwtAuth('write:n mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, }); publisher.publish(PUBSUB_TOPIC_MISC, req, { diff --git a/src/util/ValidationHelper.ts b/src/util/ValidationHelper.ts index 71790f590..7d23736e5 100644 --- a/src/util/ValidationHelper.ts +++ b/src/util/ValidationHelper.ts @@ -688,6 +688,7 @@ export function filterNFTBookListingInfo(bookInfo, isOwner = false) { mustClaimToView = false, hideDownload = false, enableCustomMessagePage, + tableOfContents, signedMessageText, enableSignatureImage, inLanguage, @@ -713,6 +714,7 @@ export function filterNFTBookListingInfo(bookInfo, isOwner = false) { mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, signedMessageText, enableSignatureImage, inLanguage, diff --git a/src/util/api/likernft/book/index.ts b/src/util/api/likernft/book/index.ts index c0aaf5d30..7c2e9d2af 100644 --- a/src/util/api/likernft/book/index.ts +++ b/src/util/api/likernft/book/index.ts @@ -130,6 +130,7 @@ export async function newNftBookInfo(classId, data, apiWalletOwnedNFTIds: string mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, inLanguage, name, @@ -185,6 +186,7 @@ export async function newNftBookInfo(classId, data, apiWalletOwnedNFTIds: string if (enableCustomMessagePage !== undefined) { payload.enableCustomMessagePage = enableCustomMessagePage; } + if (tableOfContents) payload.tableOfContents = tableOfContents; let batch = db.batch(); batch.create(likeNFTBookCollection.doc(classId), payload); if (apiWalletOwnedNFTIds.length) { @@ -289,6 +291,7 @@ export async function updateNftBookInfo(classId: string, { mustClaimToView, hideDownload, enableCustomMessagePage, + tableOfContents, }: { prices?: any[]; notificationEmails?: string[]; @@ -298,6 +301,7 @@ export async function updateNftBookInfo(classId: string, { mustClaimToView?: boolean; hideDownload?: boolean; enableCustomMessagePage?: boolean; + tableOfContents?: string; } = {}, newAPIWalletOwnedNFTIds: string[] = []) { await syncNFTBookInfoWithISCN(classId); @@ -317,6 +321,7 @@ export async function updateNftBookInfo(classId: string, { if (enableCustomMessagePage !== undefined) { payload.enableCustomMessagePage = enableCustomMessagePage; } + if (tableOfContents !== undefined) { payload.tableOfContents = tableOfContents; } const classIdRef = likeNFTBookCollection.doc(classId); let batch = db.batch(); batch.update(classIdRef, payload);