I have the following models in my keystone.js project:
/* Bankaccount.js */
var BankAccount = new keystone.List('BankAccount');
BankAccount.add({
owner: {type: Types.Relationship, ref: 'User', initial: true, index: true},
iban: { type: Types.Text, initial: true, index: true, required: true}
...
});
/* Transaction.js*/
var Transaction = new keystone.List('Transaction', {track:true});
Transaction.add({
customerBankAccount: {type: Types.Relationship, ref: 'BankAccount', initial: true, index: true, required: true },
merchantBankAccount: {type: Types.Relationship, ref: 'BankAccount', initial: true, index: true, required: true },
...
});
/* User.js */
var User = new keystone.List('User', {track:true});
User.add({
name: { type: Types.Name, initial: true, index: true},
email: { type: Types.Email, initial: true, index: true}
...
});
Before registering my User model I want to link them back in the admin UI. For the Bankaccount linking I have:
// Linked Bank Accounts
User.relationship({
path: 'bankAccounts',
ref: 'BankAccount',
refPath: 'owner'
});
Which shows the bankaccounts of the User.
But now I want to view the transactions per User. Is there a way to do this?
Something like: refPath: 'customerBankAccount.owner'
(which doesn't work)
Or is this not supported by keystone?