Filepicker: Pass params in the POST when listing files in folder

This commit is contained in:
Djamil Legato
2018-05-16 10:59:44 -07:00
parent a6e5ceaf25
commit 44715ee09b
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import $ from 'jquery';
import { config } from 'grav-config';
import { config, uri_params } from 'grav-config';
import request from '../../utils/request';
const insertTextAt = (string, index, text) => [string.slice(0, index), text, string.slice(index)].join('');
@@ -45,10 +45,11 @@ export default class FilePickerField {
let parent = field.closest('[data-grav-filepicker]');
let name = parent.data('name');
let value = parent.data('value');
let params = JSON.stringify(uri_params || '{}');
request(url, {
method: 'post',
body: { name }
body: { name, params }
}, (response) => {
if (typeof response.files === 'undefined') {
return;

File diff suppressed because one or more lines are too long