mirror of
https://github.com/flarum/core.git
synced 2025-08-11 10:55:47 +02:00
infrastructure: use params instead of data for get requests in common/Store
This commit is contained in:
committed by
Franz Liedke
parent
703c3442da
commit
29af3e6d8b
@@ -82,13 +82,13 @@ export default class Store {
|
|||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
||||||
find(type, id, query = {}, options = {}) {
|
find(type, id, query = {}, options = {}) {
|
||||||
let data = query;
|
let params = query;
|
||||||
let url = app.forum.attribute('apiUrl') + '/' + type;
|
let url = app.forum.attribute('apiUrl') + '/' + type;
|
||||||
|
|
||||||
if (id instanceof Array) {
|
if (id instanceof Array) {
|
||||||
url += '?filter[id]=' + id.join(',');
|
url += '?filter[id]=' + id.join(',');
|
||||||
} else if (typeof id === 'object') {
|
} else if (typeof id === 'object') {
|
||||||
data = id;
|
params = id;
|
||||||
} else if (id) {
|
} else if (id) {
|
||||||
url += '/' + id;
|
url += '/' + id;
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ export default class Store {
|
|||||||
{
|
{
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url,
|
url,
|
||||||
data,
|
params,
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user