mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
fix allVotes resolveAs
This commit is contained in:
parent
00063e13d8
commit
3d1a62e628
1 changed files with 3 additions and 3 deletions
|
@ -44,10 +44,10 @@ export const makeVoteable = collection => {
|
|||
optional: true,
|
||||
viewableBy: ['guests'],
|
||||
resolveAs: {
|
||||
type: 'Vote',
|
||||
type: '[Vote]',
|
||||
resolver: async (document, args, { Users, Votes, currentUser }) => {
|
||||
const votes = Votes.find({itemId: document._id}).fetch();
|
||||
if (!votes.length) return null;
|
||||
const votes = Votes.find({ documentId: document._id }).fetch();
|
||||
if (!votes.length) return [];
|
||||
return votes;
|
||||
// return Users.restrictViewableFields(currentUser, Votes, votes);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue