File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import type { RequestHandler } from '@sveltejs/kit';
1111import * as sitemap from 'super-sitemap' ;
1212
1313import * as workBooksCrud from '$lib/services/workbooks' ;
14+
15+ import { getUrlSlugFrom } from '$lib/utils/workbooks' ;
1416import { INTERNAL_SERVER_ERROR } from '$lib/constants/http-response-status-codes' ;
1517
1618/**
@@ -40,7 +42,10 @@ export const GET: RequestHandler = async () => {
4042 const workbooks = await workBooksCrud . getWorkBooks ( ) ;
4143 publishedWorkBookIds = workbooks
4244 . filter ( ( workbook ) => workbook . isPublished )
43- . map ( ( workbook ) => String ( workbook . id ) ) ;
45+ . map ( ( workbook ) => {
46+ // Note: To get the urlSlug, passing an empty string for authorName is sufficient
47+ return getUrlSlugFrom ( { ...workbook , authorName : '' } ) ;
48+ } ) ;
4449 } catch ( e ) {
4550 const errorMessage = e instanceof Error ? e . message : 'Unknown error' ;
4651 console . error ( `Failed to generate sitemap: ${ errorMessage } ` ) ;
You can’t perform that action at this time.
0 commit comments