mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Use the PK of referring model as an alias
This commit is contained in:
parent
bdc9b4b0d8
commit
639c635885
@ -76,7 +76,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
makeQuery: async function(model, query = {}) {
|
||||
// Retrieve refering model.
|
||||
// Construct parameters object sent to the Content Manager service.
|
||||
const params = {
|
||||
...query.options,
|
||||
populate: [],
|
||||
@ -130,7 +130,7 @@ module.exports = {
|
||||
queries.push({
|
||||
ids,
|
||||
options,
|
||||
alias: _.first(Object.keys(query))
|
||||
alias: _.first(Object.keys(query)) || ref.primaryKey
|
||||
});
|
||||
|
||||
map[queries.length - 1 > 0 ? queries.length - 1 : 0] = [];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user