From 4c1d35cfa2a7dc2eb3010eba4904c52adbd525bb Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 12 Jul 2019 21:22:53 -0600 Subject: [PATCH 1/7] Update InternalApiController, add bookmarks api --- app/Http/Controllers/InternalApiController.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php index 61b52fe2e..f6ddff916 100644 --- a/app/Http/Controllers/InternalApiController.php +++ b/app/Http/Controllers/InternalApiController.php @@ -306,4 +306,18 @@ class InternalApiController extends Controller Cache::forget('profile:status_count:'.$profile->id); return $status->url(); } + + public function bookmarks(Request $request) + { + $statuses = Auth::user()->profile + ->bookmarks() + ->withCount(['likes','comments']) + ->orderBy('created_at', 'desc') + ->simplePaginate(10); + + $resource = new Fractal\Resource\Collection($statuses, new StatusTransformer()); + $res = $this->fractal->createData($resource)->toArray(); + + return response()->json($res); + } } From 218f21593890955a53ecb03e4f36fc7ed4e2d5fa Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 12 Jul 2019 21:34:42 -0600 Subject: [PATCH 2/7] Update SettingsController --- app/Http/Controllers/SettingsController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index 769c9073a..c78bad9ee 100644 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -192,8 +192,14 @@ class SettingsController extends Controller $patreon = Str::startsWith($request->input('patreon'), 'https://') ? substr($request->input('patreon'), 8) : $request->input('patreon'); - $liberapay = Str::startsWith($request->input('liberapay'), 'https://') ? substr($request->input('liberapay'), 8) : $request->input('liberapay'); - $opencollective = Str::startsWith($request->input('opencollective'), 'https://') ? substr($request->input('opencollective'), 8) : $request->input('opencollective'); + + $liberapay = Str::startsWith($request->input('liberapay'), 'https://') ? + substr($request->input('liberapay'), 8) : + $request->input('liberapay'); + + $opencollective = Str::startsWith($request->input('opencollective'), 'https://') ? + substr($request->input('opencollective'), 8) : + $request->input('opencollective'); $patreon = Str::startsWith($patreon, 'patreon.com/') ? e($patreon) : null; $liberapay = Str::startsWith($liberapay, 'liberapay.com/') ? e($liberapay) : null; From 5174a11821517efe3adcb763b00f4a63efedbfdf Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 12 Jul 2019 21:49:05 -0600 Subject: [PATCH 3/7] Update Profile.vue component --- resources/assets/js/components/Profile.vue | 980 +++++++++++---------- 1 file changed, 493 insertions(+), 487 deletions(-) diff --git a/resources/assets/js/components/Profile.vue b/resources/assets/js/components/Profile.vue index b3e53504d..e25c9fa0f 100644 --- a/resources/assets/js/components/Profile.vue +++ b/resources/assets/js/components/Profile.vue @@ -1,524 +1,526 @@ -