test: fix spec

This commit is contained in:
Barış Soner Uşaklı
2026-02-12 23:22:10 -05:00
parent 0b7df274c3
commit 0e2a42d547
7 changed files with 21 additions and 3 deletions

View File

@@ -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"

View File

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

View File

@@ -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"

View File

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

View File

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

View File

@@ -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"

View File

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