refactor: events are returned inside post objects

to load all events of a topic use api/v3/topics/:tid/events
This commit is contained in:
Barış Soner Uşaklı
2025-02-06 19:59:09 -05:00
parent 1f8e2f9aad
commit 3ab22c2c8c
2 changed files with 0 additions and 14 deletions

View File

@@ -50,19 +50,6 @@ get:
type: array type: array
items: items:
$ref: ../../components/schemas/PostObject.yaml#/PostDataObject $ref: ../../components/schemas/PostObject.yaml#/PostDataObject
events:
type: array
items:
type: object
properties:
type:
type: string
id:
type: number
timestamp:
type: number
timestampISO:
type: string
category: category:
$ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject $ref: ../../components/schemas/CategoryObject.yaml#/CategoryObject
tagWhitelist: tagWhitelist:

View File

@@ -192,7 +192,6 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev
topicData.thumbs = thumbs[0]; topicData.thumbs = thumbs[0];
topicData.posts = posts; topicData.posts = posts;
topicData.events = events;
topicData.posts.forEach((p) => { topicData.posts.forEach((p) => {
p.events = events.filter( p.events = events.filter(
event => event.timestamp >= p.eventStart && event.timestamp < p.eventEnd event => event.timestamp >= p.eventStart && event.timestamp < p.eventEnd