Skip to content

Instantly share code, notes, and snippets.

@lynndylanhurley
Created November 2, 2018 18:01
Show Gist options
  • Save lynndylanhurley/312679f60d008db78c3dfd4374e7b887 to your computer and use it in GitHub Desktop.
Save lynndylanhurley/312679f60d008db78c3dfd4374e7b887 to your computer and use it in GitHub Desktop.
return (
<Resource
id={cardId}
type="cards"
endpoint={endpoint}
componentClass={CardDetailPage}
componentProps={{
match,
orgId,
cardId,
deckId,
catId,
}}
query={{
card: {
id: cardId,
fields: [
'title',
'cardType',
'link',
'subTitle',
'frontImage',
'backImage',
'backDescription',
'youtubeVideoId',
'file',
],
include: {
activityItems: {
where: { ownerId: cardId },
fields: ['description', 'actorId'],
include: {
actor: {
id: { fromContext: 'activityItem.actorId' } },
fields: [
'actorType',
]
}
}
},
cardDecks: {
readOnly: true,
where: { cardId, deckId },
fields: ['cardId', 'deckId', 'published'],
include: {
deck: {
readOnly: true,
id: deckId,
fields: ['title'],
},
},
},
},
},
}}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment