From e444181940a0e9f2a3efeb4ee58a918004c2dc51 Mon Sep 17 00:00:00 2001 From: Murtaza Sultani Date: Thu, 2 Oct 2025 13:19:07 +0200 Subject: Add post log and extract post log from admin tag --- lib/classes/JsonApi/Routes/Forum/DiscussionPostings.php | 3 +-- lib/classes/JsonApi/Routes/Forum/PostingShow.php | 3 +-- lib/classes/JsonApi/Routes/Forum/PostingStore.php | 3 +-- lib/classes/JsonApi/Routes/Forum/PostingUpdate.php | 3 +-- lib/classes/JsonApi/Schemas/Forum/Posting.php | 1 - resources/vue/components/forum/posts/PostEditForm.vue | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/classes/JsonApi/Routes/Forum/DiscussionPostings.php b/lib/classes/JsonApi/Routes/Forum/DiscussionPostings.php index acc3a5b..56eaa69 100644 --- a/lib/classes/JsonApi/Routes/Forum/DiscussionPostings.php +++ b/lib/classes/JsonApi/Routes/Forum/DiscussionPostings.php @@ -19,8 +19,7 @@ class DiscussionPostings extends JsonApiController \JsonApi\Schemas\Forum\Posting::REL_AUTHOR, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS_USER, - \JsonApi\Schemas\Forum\Posting::REL_EDITOR, - \JsonApi\Schemas\Forum\Posting::REL_LOGS_USER + \JsonApi\Schemas\Forum\Posting::REL_EDITOR ]; public function __invoke(Request $request, Response $response, $args) diff --git a/lib/classes/JsonApi/Routes/Forum/PostingShow.php b/lib/classes/JsonApi/Routes/Forum/PostingShow.php index 39f9f7c..00dd7b1 100644 --- a/lib/classes/JsonApi/Routes/Forum/PostingShow.php +++ b/lib/classes/JsonApi/Routes/Forum/PostingShow.php @@ -17,8 +17,7 @@ class PostingShow extends JsonApiController \JsonApi\Schemas\Forum\Posting::REL_OPENGRAPH_URLS, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS_USER, - \JsonApi\Schemas\Forum\Posting::REL_EDITOR, - \JsonApi\Schemas\Forum\Posting::REL_LOGS_USER + \JsonApi\Schemas\Forum\Posting::REL_EDITOR ]; public function __invoke(Request $request, Response $response, $args) diff --git a/lib/classes/JsonApi/Routes/Forum/PostingStore.php b/lib/classes/JsonApi/Routes/Forum/PostingStore.php index cc3876f..6d6e96f 100644 --- a/lib/classes/JsonApi/Routes/Forum/PostingStore.php +++ b/lib/classes/JsonApi/Routes/Forum/PostingStore.php @@ -25,8 +25,7 @@ class PostingStore extends JsonApiController \JsonApi\Schemas\Forum\Posting::REL_AUTHOR, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS_USER, - \JsonApi\Schemas\Forum\Posting::REL_EDITOR, - \JsonApi\Schemas\Forum\Posting::REL_LOGS_USER + \JsonApi\Schemas\Forum\Posting::REL_EDITOR ]; public function __invoke(Request $request, Response $response, $args) diff --git a/lib/classes/JsonApi/Routes/Forum/PostingUpdate.php b/lib/classes/JsonApi/Routes/Forum/PostingUpdate.php index 068f840..9f92e00 100644 --- a/lib/classes/JsonApi/Routes/Forum/PostingUpdate.php +++ b/lib/classes/JsonApi/Routes/Forum/PostingUpdate.php @@ -21,8 +21,7 @@ class PostingUpdate extends JsonApiController \JsonApi\Schemas\Forum\Posting::REL_AUTHOR, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS, \JsonApi\Schemas\Forum\Posting::REL_REACTIONS_USER, - \JsonApi\Schemas\Forum\Posting::REL_EDITOR, - \JsonApi\Schemas\Forum\Posting::REL_LOGS_USER + \JsonApi\Schemas\Forum\Posting::REL_EDITOR ]; public function __invoke(Request $request, Response $response, $args) diff --git a/lib/classes/JsonApi/Schemas/Forum/Posting.php b/lib/classes/JsonApi/Schemas/Forum/Posting.php index 97cdf7d..c0a47a4 100644 --- a/lib/classes/JsonApi/Schemas/Forum/Posting.php +++ b/lib/classes/JsonApi/Schemas/Forum/Posting.php @@ -17,7 +17,6 @@ class Posting extends SchemaProvider const REL_REACTIONS_USER = 'reactions.user'; const REL_OPENGRAPH_URLS = 'opengraph-urls'; const REL_EDITOR = 'editor'; - const REL_LOGS_USER = 'logs.user'; /** * @param \Forum\Posting $resource diff --git a/resources/vue/components/forum/posts/PostEditForm.vue b/resources/vue/components/forum/posts/PostEditForm.vue index 20c665e..1835e74 100644 --- a/resources/vue/components/forum/posts/PostEditForm.vue +++ b/resources/vue/components/forum/posts/PostEditForm.vue @@ -43,7 +43,7 @@ const updatePost = async () => { isLoading.value = true; const response = await STUDIP.jsonapi.withPromises().PATCH( - `forum-postings/${props.post.id}?include=opengraph-urls,posting,logs,logs.user&fields[users]=id,username,formatted-name`, + `forum-postings/${props.post.id}?include=opengraph-urls,posting,editor&fields[users]=id,username,formatted-name`, { data: getPostJSONAPIObject } ); -- cgit v1.0