@@ -31,7 +31,7 @@ class DrupalCe {
3131 * @returns {Promise<void> }
3232 */
3333 async fetchMenu ( name , config = { } ) {
34- await this . context . store . dispatch ( 'drupalCe/getMenu' , { name, config, context : this . context , axios : this . $axios } )
34+ await this . context . store . dispatch ( 'drupalCe/getMenu' , { name, config, context : this . context , options : this . options , axios : this . $axios } )
3535 }
3636
3737 /**
@@ -115,10 +115,12 @@ const storeModule = {
115115 addMessage ( { commit } , message ) {
116116 commit ( 'addMessage' , message )
117117 } ,
118- async getMenu ( { commit } , { name, config, context, axios } ) {
118+ async getMenu ( { commit } , { name, config, context, options , axios } ) {
119119 config . params = config . params ?? { }
120- config . params . no_request_rewrite = 1
121- const path = `menu_items/${ name } `
120+ if ( options . addNoRequestRewriteForMenus ) {
121+ config . params . no_request_rewrite = 1
122+ }
123+ const path = `${ options . menuEndpoint } /${ name } `
122124 try {
123125 const { data } = await axios . get ( path , config )
124126 commit ( 'setMenu' , { name, data } )
0 commit comments