mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: iteration logic bug
This commit is contained in:
@@ -22,8 +22,18 @@ get:
|
|||||||
status:
|
status:
|
||||||
$ref: ../../../components/schemas/Status.yaml#/Status
|
$ref: ../../../components/schemas/Status.yaml#/Status
|
||||||
response:
|
response:
|
||||||
type: object
|
type: array
|
||||||
properties: {}
|
description: A list of the topic thumbnails that still remain
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
description: Path to a topic thumbnail
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- topics
|
- topics
|
||||||
@@ -141,6 +151,10 @@ delete:
|
|||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
url:
|
url:
|
||||||
type: string
|
type: string
|
||||||
description: Path to a topic thumbnail
|
description: Path to a topic thumbnail
|
||||||
@@ -29,7 +29,7 @@ Thumbs.get = async function (tids) {
|
|||||||
|
|
||||||
const sets = tids.map(tid => `${validator.isUUID(String(tid)) ? 'draft' : 'topic'}:${tid}:thumbs`);
|
const sets = tids.map(tid => `${validator.isUUID(String(tid)) ? 'draft' : 'topic'}:${tid}:thumbs`);
|
||||||
const thumbs = await db.getSortedSetsMembers(sets);
|
const thumbs = await db.getSortedSetsMembers(sets);
|
||||||
let response = thumbs.map(thumbSet => thumbSet.map((thumb, idx) => ({
|
let response = thumbs.map((thumbSet, idx) => thumbSet.map(thumb => ({
|
||||||
id: tids[idx],
|
id: tids[idx],
|
||||||
name: path.basename(thumb),
|
name: path.basename(thumb),
|
||||||
url: path.join(nconf.get('upload_url'), thumb),
|
url: path.join(nconf.get('upload_url'), thumb),
|
||||||
|
|||||||
Reference in New Issue
Block a user