mirror of
https://github.com/wassname/talk.git
synced 2026-10-04 13:10:23 +08:00
small fixes for db logic
This commit is contained in:
1 parent
0e2a37ac91
commit
b60e62f976
1 file changed
+4
-4
+4
-4
@@ -237,7 +237,9 @@ class Users {
|
||||
|
||||
static async setUsername(id, username, assignedBy) {
|
||||
try {
|
||||
const oldestEditTime = moment().subtract(14, 'days');
|
||||
const oldestEditTime = moment()
|
||||
.subtract(14, 'days')
|
||||
.toDate();
|
||||
|
||||
// A username can be set if:
|
||||
//
|
||||
@@ -252,9 +254,7 @@ class Users {
|
||||
{
|
||||
'status.username.status': { $in: ['APPROVED', 'SET'] },
|
||||
'status.username.history.created_at': {
|
||||
$not: {
|
||||
$gte: oldestEditTime,
|
||||
},
|
||||
$lte: oldestEditTime,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user