Update files
This commit is contained in:
parent
bc2d103e50
commit
834982ef6c
|
|
@ -330,3 +330,4 @@ pm2 env <app_name>
|
|||
**Рекомендация:** Используйте **MongoDB Atlas** для production - это безопасно, надежно и бесплатно для малых проектов!
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ const ensureUserSettings = async (user) => {
|
|||
updated = true;
|
||||
} else {
|
||||
if (user.settings.whitelist.noNSFW === undefined) {
|
||||
user.settings.whitelist.noNSFW = true;
|
||||
updated = true;
|
||||
user.settings.whitelist.noNSFW = true;
|
||||
updated = true;
|
||||
}
|
||||
if (user.settings.whitelist.noHomo === undefined) {
|
||||
user.settings.whitelist.noHomo = true;
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ router.get('/:id/posts', authenticate, async (req, res) => {
|
|||
if (req.user.settings?.whitelist?.noHomo) {
|
||||
query.isHomo = { $ne: true };
|
||||
}
|
||||
|
||||
|
||||
const posts = await Post.find(query)
|
||||
.populate('author', 'username firstName lastName photoUrl')
|
||||
.sort({ createdAt: -1 })
|
||||
|
|
@ -160,7 +160,7 @@ router.put('/profile', authenticate, async (req, res) => {
|
|||
req.user.settings.whitelist = { noNSFW: true, noHomo: true };
|
||||
} else {
|
||||
if (req.user.settings.whitelist.noNSFW === undefined) {
|
||||
req.user.settings.whitelist.noNSFW = true;
|
||||
req.user.settings.whitelist.noNSFW = true;
|
||||
}
|
||||
if (req.user.settings.whitelist.noHomo === undefined) {
|
||||
req.user.settings.whitelist.noHomo = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue