mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-26 08:31:22 +01:00
fix: add sourceContent prop to posts API; fix other tests
This commit is contained in:
@@ -22,53 +22,65 @@ get:
|
|||||||
status:
|
status:
|
||||||
$ref: ../../components/schemas/Status.yaml#/Status
|
$ref: ../../components/schemas/Status.yaml#/Status
|
||||||
response:
|
response:
|
||||||
type: object
|
allOf:
|
||||||
properties:
|
- type: object
|
||||||
pid:
|
properties:
|
||||||
type: number
|
pid:
|
||||||
uid:
|
type: number
|
||||||
type: number
|
uid:
|
||||||
description: A user identifier
|
type: number
|
||||||
tid:
|
description: A user identifier
|
||||||
type: number
|
tid:
|
||||||
description: A topic identifier
|
type: number
|
||||||
content:
|
description: A topic identifier
|
||||||
type: string
|
content:
|
||||||
timestamp:
|
type: string
|
||||||
type: number
|
timestamp:
|
||||||
flagId:
|
type: number
|
||||||
type: number
|
flagId:
|
||||||
deleted:
|
type: number
|
||||||
type: number
|
deleted:
|
||||||
upvotes:
|
type: number
|
||||||
type: number
|
upvotes:
|
||||||
downvotes:
|
type: number
|
||||||
type: number
|
downvotes:
|
||||||
deleterUid:
|
type: number
|
||||||
type: number
|
deleterUid:
|
||||||
edited:
|
type: number
|
||||||
type: number
|
edited:
|
||||||
replies:
|
type: number
|
||||||
type: number
|
replies:
|
||||||
bookmarks:
|
type: number
|
||||||
type: number
|
bookmarks:
|
||||||
votes:
|
type: number
|
||||||
type: number
|
votes:
|
||||||
timestampISO:
|
type: number
|
||||||
type: string
|
timestampISO:
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
type: string
|
||||||
editedISO:
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
type: string
|
editedISO:
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
type: string
|
||||||
upvoted:
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
type: boolean
|
upvoted:
|
||||||
downvoted:
|
type: boolean
|
||||||
type: boolean
|
downvoted:
|
||||||
attachments:
|
type: boolean
|
||||||
type: array
|
attachments:
|
||||||
items:
|
type: array
|
||||||
type: string
|
items:
|
||||||
description: A sha256 hash of the attachment (tied to the corresponding entry in the database)
|
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:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- posts
|
- posts
|
||||||
|
|||||||
@@ -1915,12 +1915,12 @@ describe('Controllers', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should deny access if view:users privilege is not enabled for guests', async () => {
|
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}`);
|
const { response } = await request.get(`${nconf.get('url')}/.well-known/webfinger?resource=acct:${username}@${nconf.get('url_parsed').host}`);
|
||||||
assert.strictEqual(response.statusCode, 400);
|
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 () => {
|
it('should respond appropriately if the user requested does not exist locally', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user