From f783338621507bbcad051d3c2d9cb8098a592698 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 11 Apr 2024 13:43:29 -0400 Subject: [PATCH] fix: #12496, url in schema --- public/openapi/components/schemas/PostObject.yaml | 5 +++++ src/posts/create.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/public/openapi/components/schemas/PostObject.yaml b/public/openapi/components/schemas/PostObject.yaml index f6194dd75c..914ca40837 100644 --- a/public/openapi/components/schemas/PostObject.yaml +++ b/public/openapi/components/schemas/PostObject.yaml @@ -11,6 +11,11 @@ PostObject: type: number description: The post that this post is in reply to nullable: true + url: + type: string + description: | + A permalink to the post content. + For posts received via ActivityPub, it is the url of the original piece of content. content: type: string uid: diff --git a/src/posts/create.js b/src/posts/create.js index d38aec356e..2c23560266 100644 --- a/src/posts/create.js +++ b/src/posts/create.js @@ -44,7 +44,7 @@ module.exports = function (Posts) { if (data.handle && !parseInt(uid, 10)) { postData.handle = data.handle; } - if (_activitypub.url) { + if (_activitypub && _activitypub.url) { postData.url = _activitypub.url; }