From f33061642a67c396bd753170aa74934e975be96e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 21 Jul 2020 19:14:48 -0600 Subject: [PATCH] Update comments, fix remote reply bug --- app/Http/Controllers/PublicApiController.php | 2 +- resources/assets/js/components/PostComponent.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 41f6bf991..8dab9b65f 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -110,7 +110,7 @@ class PublicApiController extends Controller ]); $limit = $request->limit ?? 10; - $profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail(); + $profile = Profile::whereNull('status')->findOrFail($username); $status = Status::whereProfileId($profile->id)->whereCommentsDisabled(false)->findOrFail($postId); $this->scopeCheck($profile, $status); diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue index 9b74c8663..14bf2ad4f 100644 --- a/resources/assets/js/components/PostComponent.vue +++ b/resources/assets/js/components/PostComponent.vue @@ -1120,7 +1120,7 @@ export default { }, fetchComments() { - let url = '/api/v2/comments/'+this.statusUsername+'/status/'+this.statusId; + let url = '/api/v2/comments/'+this.statusProfileId+'/status/'+this.statusId; axios.get(url) .then(response => { let self = this; @@ -1306,7 +1306,7 @@ export default { reply.thread = true; return; } - let url = '/api/v2/comments/'+reply.account.username+'/status/'+reply.id; + let url = '/api/v2/comments/'+reply.account.id+'/status/'+reply.id; axios.get(url) .then(response => { reply.replies = _.reverse(response.data.data);