MOBILE-4270 glossary: Fix link handler

main
Noel De Martin 2023-05-11 17:25:48 +02:00
parent a0f1a808c7
commit c03f656af1
2 changed files with 14 additions and 2 deletions

View File

@ -49,6 +49,12 @@ export const ADDON_MOD_GLOSSARY_SERVICES: Type<unknown>[] = [
]; ];
const mainMenuRoutes: Routes = [ const mainMenuRoutes: Routes = [
// Link handlers navigation.
{
path: `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/:entrySlug`,
loadChildren: () => import('./glossary-entry-lazy.module').then(m => m.AddonModGlossaryEntryLazyModule),
},
// Course activity navigation. // Course activity navigation.
{ {
path: AddonModGlossaryModuleHandlerService.PAGE_NAME, path: AddonModGlossaryModuleHandlerService.PAGE_NAME,

View File

@ -56,8 +56,14 @@ export class AddonModGlossaryEntryLinkHandlerService extends CoreContentLinksHan
); );
await CoreNavigator.navigateToSitePath( await CoreNavigator.navigateToSitePath(
AddonModGlossaryModuleHandlerService.PAGE_NAME + `/${module.course}/${module.id}/entry/${entryId}`, `${AddonModGlossaryModuleHandlerService.PAGE_NAME}/entry/${entryId}`,
{ siteId }, {
siteId,
params: {
courseId: module.course,
cmId: module.id,
},
},
); );
} catch (error) { } catch (error) {
CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentry', true); CoreDomUtils.showErrorModalDefault(error, 'addon.mod_glossary.errorloadingentry', true);