mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: add sourceContent prop to posts API; fix other tests
This commit is contained in:
@@ -22,53 +22,65 @@ get:
|
||||
status:
|
||||
$ref: ../../components/schemas/Status.yaml#/Status
|
||||
response:
|
||||
type: object
|
||||
properties:
|
||||
pid:
|
||||
type: number
|
||||
uid:
|
||||
type: number
|
||||
description: A user identifier
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
content:
|
||||
type: string
|
||||
timestamp:
|
||||
type: number
|
||||
flagId:
|
||||
type: number
|
||||
deleted:
|
||||
type: number
|
||||
upvotes:
|
||||
type: number
|
||||
downvotes:
|
||||
type: number
|
||||
deleterUid:
|
||||
type: number
|
||||
edited:
|
||||
type: number
|
||||
replies:
|
||||
type: number
|
||||
bookmarks:
|
||||
type: number
|
||||
votes:
|
||||
type: number
|
||||
timestampISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
editedISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
upvoted:
|
||||
type: boolean
|
||||
downvoted:
|
||||
type: boolean
|
||||
attachments:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: A sha256 hash of the attachment (tied to the corresponding entry in the database)
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
pid:
|
||||
type: number
|
||||
uid:
|
||||
type: number
|
||||
description: A user identifier
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
content:
|
||||
type: string
|
||||
timestamp:
|
||||
type: number
|
||||
flagId:
|
||||
type: number
|
||||
deleted:
|
||||
type: number
|
||||
upvotes:
|
||||
type: number
|
||||
downvotes:
|
||||
type: number
|
||||
deleterUid:
|
||||
type: number
|
||||
edited:
|
||||
type: number
|
||||
replies:
|
||||
type: number
|
||||
bookmarks:
|
||||
type: number
|
||||
votes:
|
||||
type: number
|
||||
timestampISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
editedISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
upvoted:
|
||||
type: boolean
|
||||
downvoted:
|
||||
type: boolean
|
||||
attachments:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: A sha256 hash of the attachment (tied to the corresponding entry in the database)
|
||||
- type: object
|
||||
description: Optional properties that may or may not be present (except for `pid`, which is always present, and is only here as a hack to pass validation)
|
||||
properties:
|
||||
pid:
|
||||
type: number
|
||||
description: A post identifier
|
||||
sourceContent:
|
||||
type: string
|
||||
description: The markdown equivalent of a remote post content, as received (or fetched) from the remote site.
|
||||
required:
|
||||
- pid
|
||||
put:
|
||||
tags:
|
||||
- posts
|
||||
|
||||
@@ -1915,12 +1915,12 @@ describe('Controllers', () => {
|
||||
});
|
||||
|
||||
it('should deny access if view:users privilege is not enabled for guests', async () => {
|
||||
await privileges.global.rescind(['groups:view:users'], 'guests');
|
||||
await privileges.global.rescind(['groups:view:users'], 'fediverse');
|
||||
|
||||
const { response } = await request.get(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').host}`);
|
||||
assert.strictEqual(response.statusCode, 400);
|
||||
|
||||
await privileges.global.give(['groups:view:users'], 'guests');
|
||||
await privileges.global.give(['groups:view:users'], 'fediverse');
|
||||
});
|
||||
|
||||
it('should respond appropriately if the user requested does not exist locally', async () => {
|
||||
|
||||
Reference in New Issue
Block a user