Skip to content

Commit 3d02ab4

Browse files
maximilianmikusfago
authored andcommitted
LDP-697 Use replacement string for menu name.
1 parent a37114c commit 3d02ab4

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/module.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ const { resolve } = require('path')
44
module.exports = async function (moduleOptions) {
55
const defaultOptions = {
66
baseURL: process.env.DRUPAL_BASE_URL || 'http://localhost:8888',
7-
menuEndpoint: 'menu_items',
7+
menuEndpoint: 'menu_items/$$$NAME$$$',
88
addRequestFormat: 'custom_elements',
99
addRequestContentFormat: false,
10-
addNoRequestRewriteForMenus: true,
1110
addVueCompiler: true,
1211
useProxy: 'dev-only',
1312
axios: {}

lib/plugin.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ const storeModule = {
117117
},
118118
async getMenu ({ commit }, { name, config, context, options, axios }) {
119119
config.params = config.params ?? {}
120-
if (options.addNoRequestRewriteForMenus) {
121-
config.params.no_request_rewrite = 1
122-
}
123-
const path = `${options.menuEndpoint}/${name}`
120+
const path = options.menuEndpoint.replace('$$$NAME$$$', name)
124121
try {
125122
const { data } = await axios.get(path, config)
126123
commit('setMenu', { name, data })

0 commit comments

Comments
 (0)