diff --git a/src/admin.js b/src/admin.js index 2be479b..6bd4c22 100644 --- a/src/admin.js +++ b/src/admin.js @@ -21,9 +21,19 @@ const selector = '#side-menu-message' const userConfig = (name, value, callbacks) => { const url = OC.generateUrl('/apps/side_menu/personalSetting/valueSet') + const formData = new FormData() + formData.append('name', name) + formData.append('value', value) - $.post(url, {name: name, value: value}, callbacks.success) - .fail(callbacks.error) + fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: formData + }) + .then(callbacks.success) + .catch(callbacks.error) } const appConfig = (name, value, callbacks) => {