From 88a5dfb7b79c25cb804afeee443f7f08d2283519 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 26 Apr 2024 12:14:11 -0400 Subject: [PATCH 1/2] fix: unintentional object pollution by buildForSelectCategories --- src/categories/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/categories/index.js b/src/categories/index.js index 5e5efd921a..b266788b3a 100644 --- a/src/categories/index.js +++ b/src/categories/index.js @@ -370,7 +370,7 @@ async function getSelectData(cids, fields) { } Categories.buildForSelectCategories = function (categories, fields, parentCid) { - function recursive(category, categoriesData, level, depth) { + function recursive({ ...category }, categoriesData, level, depth) { const bullet = level ? '• ' : ''; category.value = category.cid; category.level = level; From 2a58d0996d6bdc13a2439f2b98892a225fe5d51d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 26 Apr 2024 14:11:36 -0400 Subject: [PATCH 2/2] fix: use reference object for post summary v3 api call --- public/openapi/write/posts/pid/summary.yaml | 38 +-------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/public/openapi/write/posts/pid/summary.yaml b/public/openapi/write/posts/pid/summary.yaml index 29d46c4129..59d5599065 100644 --- a/public/openapi/write/posts/pid/summary.yaml +++ b/public/openapi/write/posts/pid/summary.yaml @@ -31,40 +31,4 @@ get: status: $ref: ../../../components/schemas/Status.yaml#/Status response: - type: object - properties: - pid: - type: number - tid: - type: number - description: A topic identifier - content: - type: string - uid: - type: number - description: A user identifier - timestamp: - type: number - deleted: - type: number - upvotes: - type: number - downvotes: - type: number - replies: - type: number - votes: - type: number - timestampISO: - type: string - user: - type: object - additionalProperties: {} - topic: - type: object - additionalProperties: {} - category: - type: object - additionalProperties: {} - isMainPost: - type: boolean \ No newline at end of file + $ref: ../../../components/schemas/PostObject.yaml#/PostObject