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