mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
test: fix spec
This commit is contained in:
@@ -108,6 +108,10 @@ MessageObject:
|
||||
`icon:text` for the user's
|
||||
auto-generated icon
|
||||
example: "#f44336"
|
||||
banned_until:
|
||||
type: number
|
||||
description: A UNIX timestamp representing the moment a ban will be lifted
|
||||
example: 0
|
||||
banned_until_readable:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"
|
||||
|
||||
@@ -60,8 +60,6 @@ TopicObject:
|
||||
signature:
|
||||
type: string
|
||||
nullable: true
|
||||
banned:
|
||||
type: number
|
||||
status:
|
||||
type: string
|
||||
icon:text:
|
||||
@@ -76,6 +74,10 @@ TopicObject:
|
||||
`icon:text` for the user's auto-generated
|
||||
icon
|
||||
example: "#f44336"
|
||||
banned:
|
||||
type: number
|
||||
banned_until:
|
||||
type: number
|
||||
banned_until_readable:
|
||||
type: string
|
||||
required:
|
||||
|
||||
@@ -681,6 +681,10 @@ UserObjectACP:
|
||||
lastonlineISO:
|
||||
type: string
|
||||
example: '2020-03-27T20:30:36.590Z'
|
||||
banned_until:
|
||||
type: number
|
||||
description: A UNIX timestamp representing the moment a ban will be lifted
|
||||
example: 0
|
||||
banned_until_readable:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"
|
||||
|
||||
@@ -109,6 +109,8 @@ get:
|
||||
`icon:text` for the user's auto-generated
|
||||
icon
|
||||
example: "#f44336"
|
||||
banned_until:
|
||||
type: number
|
||||
banned_until_readable:
|
||||
type: string
|
||||
required:
|
||||
|
||||
@@ -124,6 +124,8 @@ get:
|
||||
`icon:text` for the user's auto-generated
|
||||
icon
|
||||
example: "#f44336"
|
||||
banned_until:
|
||||
type: number
|
||||
banned_until_readable:
|
||||
type: string
|
||||
deleted:
|
||||
|
||||
@@ -79,6 +79,10 @@ put:
|
||||
type: number
|
||||
description: A Boolean representing whether a user is banned or not
|
||||
example: 0
|
||||
banned_until:
|
||||
type: number
|
||||
description: A UNIX timestamp representing the moment a ban will be lifted
|
||||
example: 0
|
||||
banned_until_readable:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string representing the moment a ban will be lifted, or the words "Not Banned"
|
||||
|
||||
@@ -275,7 +275,7 @@ module.exports = function (User) {
|
||||
user.joindateISO = utils.toISOString(user.joindate);
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty('lastonline')) {
|
||||
if (user.hasOwnProperty('lastonline') && (!requestedFields.length || requestedFields.includes('lastonline')) && !fieldsToRemove.includes('lastonline')) {
|
||||
user.lastonlineISO = utils.toISOString(user.lastonline) || user.joindateISO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user