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 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: {

View File

@ -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}){

View File

@ -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}`,

View File

@ -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) {
}; };