Girdilere sayaç eklendi.

This commit is contained in:
batuhancoskun 2025-06-15 02:28:04 +03:00
parent 5cd6fb94b9
commit 61861233fd
4 changed files with 23 additions and 16 deletions

View File

@ -364,11 +364,13 @@ exports.getBlogsForDiscover = async function({userId, endDate, blogIds = false})
userId: userId
});
followsIds.push(userId);
const blogs = await Blogs.findAll({
where:[{
[Op.not]: {
userId: [followsIds, userId]
}
[Op.not]: [{
userId: followsIds
}]
}, (endDate) ? {
createdAt: {
[Op.lt]: endDate
@ -439,12 +441,12 @@ exports.getBlogsForDiscoverWithCategory = async function({userId, category, endD
userId: userId
});
console.log(endDate, blogIds);
followsIds.push(userId);
const blogs = await Blogs.findAll({
where:[{
[Op.not]: {
userId: [followsIds, userId]
userId: followsIds
}
}, (endDate) && {
createdAt: {

View File

@ -1,12 +1,13 @@
const { Notifications } = require("../models/Notifications");
exports.createNotification = async function({data, userId, notificationCodeId}) {
// console.log(userId, notificationDraftId, data);
return await Notifications.create({
data: data,
userId: userId,
notificationCodeId: notificationCodeId
});
if(userId !== data.user){
return await Notifications.create({
data: data,
userId: userId,
notificationCodeId: notificationCodeId
});
}
};
exports.readedNotification = async function({notificationId}){

View File

@ -14,7 +14,7 @@ exports.repairNotifications = async function(data){
code: notification.notificationCode.code,
datetime: new Object()
});
rslt.blog = await getBlog({blogId: datas.blog}).then(res => {
if(res){
return {
@ -27,8 +27,6 @@ exports.repairNotifications = async function(data){
}
});
console.log(56);
rslt.user = await getUserWithId({userId: datas.user}).then(res => {
return {
name: `${res.first_name} ${res.second_name}`,
@ -41,6 +39,6 @@ exports.repairNotifications = async function(data){
result.push(rslt);
};
return result;
};

View File

@ -12,7 +12,13 @@ router.get("/get/peoples", auth, async (req, res) => {
router.get("/get/user/my", auth, async (req, res) => {
try {
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) {
};