Girdilere sayaç eklendi.
This commit is contained in:
parent
5cd6fb94b9
commit
61861233fd
@ -364,11 +364,13 @@ exports.getBlogsForDiscover = async function({userId, endDate, blogIds = false})
|
|||||||
userId: userId
|
userId: userId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
followsIds.push(userId);
|
||||||
|
|
||||||
const blogs = await Blogs.findAll({
|
const blogs = await Blogs.findAll({
|
||||||
where:[{
|
where:[{
|
||||||
[Op.not]: {
|
[Op.not]: [{
|
||||||
userId: [followsIds, userId]
|
userId: followsIds
|
||||||
}
|
}]
|
||||||
}, (endDate) ? {
|
}, (endDate) ? {
|
||||||
createdAt: {
|
createdAt: {
|
||||||
[Op.lt]: endDate
|
[Op.lt]: endDate
|
||||||
@ -439,12 +441,12 @@ exports.getBlogsForDiscoverWithCategory = async function({userId, category, endD
|
|||||||
userId: userId
|
userId: userId
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(endDate, blogIds);
|
followsIds.push(userId);
|
||||||
|
|
||||||
const blogs = await Blogs.findAll({
|
const blogs = await Blogs.findAll({
|
||||||
where:[{
|
where:[{
|
||||||
[Op.not]: {
|
[Op.not]: {
|
||||||
userId: [followsIds, userId]
|
userId: followsIds
|
||||||
}
|
}
|
||||||
}, (endDate) && {
|
}, (endDate) && {
|
||||||
createdAt: {
|
createdAt: {
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
const { Notifications } = require("../models/Notifications");
|
const { Notifications } = require("../models/Notifications");
|
||||||
|
|
||||||
exports.createNotification = async function({data, userId, notificationCodeId}) {
|
exports.createNotification = async function({data, userId, notificationCodeId}) {
|
||||||
// console.log(userId, notificationDraftId, data);
|
if(userId !== data.user){
|
||||||
return await Notifications.create({
|
return await Notifications.create({
|
||||||
data: data,
|
data: data,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
notificationCodeId: notificationCodeId
|
notificationCodeId: notificationCodeId
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.readedNotification = async function({notificationId}){
|
exports.readedNotification = async function({notificationId}){
|
||||||
|
|||||||
@ -14,7 +14,7 @@ exports.repairNotifications = async function(data){
|
|||||||
code: notification.notificationCode.code,
|
code: notification.notificationCode.code,
|
||||||
datetime: new Object()
|
datetime: new Object()
|
||||||
});
|
});
|
||||||
|
|
||||||
rslt.blog = await getBlog({blogId: datas.blog}).then(res => {
|
rslt.blog = await getBlog({blogId: datas.blog}).then(res => {
|
||||||
if(res){
|
if(res){
|
||||||
return {
|
return {
|
||||||
@ -27,8 +27,6 @@ exports.repairNotifications = async function(data){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(56);
|
|
||||||
|
|
||||||
rslt.user = await getUserWithId({userId: datas.user}).then(res => {
|
rslt.user = await getUserWithId({userId: datas.user}).then(res => {
|
||||||
return {
|
return {
|
||||||
name: `${res.first_name} ${res.second_name}`,
|
name: `${res.first_name} ${res.second_name}`,
|
||||||
@ -41,6 +39,6 @@ exports.repairNotifications = async function(data){
|
|||||||
|
|
||||||
result.push(rslt);
|
result.push(rslt);
|
||||||
};
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -12,7 +12,13 @@ router.get("/get/peoples", auth, async (req, res) => {
|
|||||||
router.get("/get/user/my", auth, async (req, res) => {
|
router.get("/get/user/my", auth, async (req, res) => {
|
||||||
try {
|
try {
|
||||||
res.json({
|
res.json({
|
||||||
user: await getUserWithId({userId: req.session.user.id})
|
user: await getUserWithId({userId: req.session.user.id}),
|
||||||
|
config: {
|
||||||
|
min_title: process.env.BLOGS_MIN_LIMIT_TITLE,
|
||||||
|
max_title: process.env.BLOGS_MAX_LIMIT_TITLE,
|
||||||
|
min_text: process.env.BLOGS_MIN_LIMIT_TEXT,
|
||||||
|
max_text: process.env.BLOGS_MAX_LIMIT_TEXT
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user