Fix iroiro
This commit is contained in:
@ -3,10 +3,10 @@
|
||||
*/
|
||||
import $ from 'cafy';
|
||||
import Post from '../../../models/post';
|
||||
import Like from '../../../models/like';
|
||||
import Reaction from '../../../models/post-reaction';
|
||||
|
||||
/**
|
||||
* Aggregate like of a post
|
||||
* Aggregate reaction of a post
|
||||
*
|
||||
* @param {any} params
|
||||
* @return {Promise<any>}
|
||||
@ -25,7 +25,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||
return rej('post not found');
|
||||
}
|
||||
|
||||
const datas = await Like
|
||||
const datas = await Reaction
|
||||
.aggregate([
|
||||
{ $match: { post_id: post._id } },
|
||||
{ $project: {
|
@ -3,10 +3,10 @@
|
||||
*/
|
||||
import $ from 'cafy';
|
||||
import Post from '../../../models/post';
|
||||
import Like from '../../../models/like';
|
||||
import Reaction from '../../../models/post-reaction';
|
||||
|
||||
/**
|
||||
* Aggregate likes of a post
|
||||
* Aggregate reactions of a post
|
||||
*
|
||||
* @param {any} params
|
||||
* @return {Promise<any>}
|
||||
@ -27,7 +27,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||
|
||||
const startTime = new Date(new Date().setMonth(new Date().getMonth() - 1));
|
||||
|
||||
const likes = await Like
|
||||
const reactions = await Reaction
|
||||
.find({
|
||||
post_id: post._id,
|
||||
$or: [
|
||||
@ -51,8 +51,8 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||
day = new Date(day.setHours(23));
|
||||
// day = day.getTime();
|
||||
|
||||
const count = likes.filter(l =>
|
||||
l.created_at < day && (l.deleted_at == null || l.deleted_at > day)
|
||||
const count = reactions.filter(r =>
|
||||
r.created_at < day && (r.deleted_at == null || r.deleted_at > day)
|
||||
).length;
|
||||
|
||||
graph.push({
|
@ -3,10 +3,10 @@
|
||||
*/
|
||||
import $ from 'cafy';
|
||||
import User from '../../../models/user';
|
||||
import Like from '../../../models/like';
|
||||
import Reaction from '../../../models/post-reaction';
|
||||
|
||||
/**
|
||||
* Aggregate like of a user
|
||||
* Aggregate reaction of a user
|
||||
*
|
||||
* @param {any} params
|
||||
* @return {Promise<any>}
|
||||
@ -29,7 +29,7 @@ module.exports = (params) => new Promise(async (res, rej) => {
|
||||
return rej('user not found');
|
||||
}
|
||||
|
||||
const datas = await Like
|
||||
const datas = await Reaction
|
||||
.aggregate([
|
||||
{ $match: { user_id: user._id } },
|
||||
{ $project: {
|
@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
import prominence from 'prominence';
|
||||
import version from '../../version';
|
||||
import config from '../../conf';
|
||||
|
||||
|
Reference in New Issue
Block a user