From 7e29c08ea97af4f474ffb7750c6ad427cd98a669 Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Fri, 14 Jun 2024 16:46:16 +0200 Subject: [PATCH] fix: hide offline posts from get route --- api/post.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/post.go b/api/post.go index b95689f..2f05a97 100644 --- a/api/post.go +++ b/api/post.go @@ -24,7 +24,7 @@ func getPost(w http.ResponseWriter, r *http.Request) { } localPost, err := Container.GetPostUseCase.GetPost(uint32(id)) - if err != nil { + if err != nil || !localPost.IsOnline { http.Error(w, "The requested resource, identified by its unique ID, could not be found on the server.", http.StatusNotFound) return }