Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/components/tools/recent-photos.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
{{#if (can 'show photo-comments')}}
<div class='card-body'>
<div class='d-flex'>
{{#each photosWithComments as |photo|}}
{{#each latestComments as |comment|}}
<LinkTo
@route='photo-albums.photo-album.photos.photo'
@models={{array photo.photoAlbum.id photo.id}}
@models={{array comment.photo.photoAlbum.id comment.photo.id}}
class='picture-link col-xs'
>
<img class='featured-picture' src={{photo.imageThumbUrl}} />
<img class='featured-picture' src={{comment.photo.imageThumbUrl}} />
</LinkTo>
{{else}}
<div class='p-2'>
Er zijn helaas geen recente reacties op foto's!
</div>
{{/each}}
</div>
{{#if photosWithComments}}
{{#if latestComments}}
<LinkTo @route='photo-comments'>
<button class='btn btn-primary col-12 mt-2 mb-1' type='button'>
Bekijk alle reacties
Expand Down
6 changes: 3 additions & 3 deletions app/components/tools/recent-photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { computed } from '@ember/object';

export default Component.extend({
store: service(),
photosWithComments: computed(function () {
latestComments: computed(function () {
/* eslint-disable camelcase */
return this.store.query('photo', {
return this.store.query('photo-comment', {
sort: '-updated_at',
filter: { with_comments: true },
include: 'photo',
page: { number: '1', size: 4 },
});
/* eslint-enable camelcase */
Expand Down
Loading