Skip to content

Commit

Permalink
Aftral[premieroctet#71]: fixed declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
SeghirOumo committed Aug 14, 2024
1 parent 109a47e commit 75e224f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/web/server/plugins/aftral-lms/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ declareVirtualField({model:'post', field: 'likes_count', instance: 'Number', req
declareComputedField({model: 'post', field: 'liked', getterFn: isLiked, requires:'likes'})

//Resources
declareVirtualField({model: 'resources', field: 'likes_count', instance: 'Number', requires:'likes'})
declareVirtualField({model: 'resources', field: 'dislikes_count', instance: 'Number', requires:'dislikes'})
declareVirtualField({model: 'resource', field: 'likes_count', instance: 'Number', requires:'likes'})
declareVirtualField({model: 'resource', field: 'dislikes_count', instance: 'Number', requires:'dislikes'})

declareComputedField({model: 'resources', field: 'liked', getterFn: isBlockLiked, requires:'likes'})
declareComputedField({model: 'resources', field: 'disliked', getterFn: isBlockDisliked, requires:'dislikes'})
declareComputedField({model: 'resource', field: 'liked', getterFn: isBlockLiked, requires:'likes'})
declareComputedField({model: 'resource', field: 'disliked', getterFn: isBlockDisliked, requires:'dislikes'})
//Resources end
const preCreate = async ({model, params, user}) => {
params.creator=params.creator || user._id
Expand Down

0 comments on commit 75e224f

Please sign in to comment.