mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
test: fix remoteUrl property generation, tests for topic moving
This commit is contained in:
@@ -16,12 +16,6 @@ UserObject:
|
|||||||
type: string
|
type: string
|
||||||
description: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)
|
description: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)
|
||||||
example: dragon-fruit
|
example: dragon-fruit
|
||||||
remoteUrl:
|
|
||||||
type: string
|
|
||||||
description: |
|
|
||||||
URL to the remote user's original profile.
|
|
||||||
This value is present only if the requested user is not local to the forum.
|
|
||||||
nullable: true
|
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
description: Email address associated with the user account
|
description: Email address associated with the user account
|
||||||
@@ -219,12 +213,6 @@ UserObjectFull:
|
|||||||
type: string
|
type: string
|
||||||
description: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)
|
description: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)
|
||||||
example: dragon-fruit
|
example: dragon-fruit
|
||||||
remoteUrl:
|
|
||||||
type: string
|
|
||||||
description: |
|
|
||||||
URL to the remote user's original profile.
|
|
||||||
This value is present only if the requested user is not local to the forum.
|
|
||||||
nullable: true
|
|
||||||
email:
|
email:
|
||||||
type: string
|
type: string
|
||||||
description: Email address associated with the user account
|
description: Email address associated with the user account
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ put:
|
|||||||
- topics
|
- topics
|
||||||
summary: move topic to another category
|
summary: move topic to another category
|
||||||
description: |
|
description: |
|
||||||
This operation moved a topic from one category to another.
|
This operation moves a topic from one category to another.
|
||||||
|
|
||||||
**Note**: This is a privileged call and can only be executed by administrators, global moderators, or the moderator for the category of the passed-in topic.
|
**Note**: This is a privileged call and can only be executed by administrators, global moderators, or the moderator for the category of the passed-in topic.
|
||||||
parameters:
|
parameters:
|
||||||
@@ -14,6 +14,16 @@ put:
|
|||||||
required: true
|
required: true
|
||||||
description: a valid topic id
|
description: a valid topic id
|
||||||
example: 1
|
example: 1
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
cid:
|
||||||
|
type: number
|
||||||
|
example: -1
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Topic successfully moved
|
description: Topic successfully moved
|
||||||
|
|||||||
@@ -235,9 +235,10 @@ module.exports = function (User) {
|
|||||||
user.username = validator.escape(user.username ? user.username.toString() : '');
|
user.username = validator.escape(user.username ? user.username.toString() : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.hasOwnProperty('url') && !requestedFields.includes('url')) {
|
// works around renderOverride supplying `url` to templates
|
||||||
// works around renderOverride supplying `url` to templates
|
if (user.url) {
|
||||||
user.remoteUrl = user.url;
|
user.remoteUrl = user.url;
|
||||||
|
} else {
|
||||||
delete user.url;
|
delete user.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user