Skip to content

Commit

Permalink
canvas-ui fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
austintoddj committed Sep 3, 2021
1 parent 7148abf commit 5c1474a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
22 changes: 11 additions & 11 deletions resources/js/ui/views/ShowPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</span>
</p>
<span class="text-secondary"
>{{ moment(post.published_at).format('MMM D, Y') }} — {{ post.read_time }}</span
>{{ moment(post.published_at).format('MMM D, Y') }} — {{ post.read_time }}</span
>
</div>
</div>
Expand Down Expand Up @@ -115,8 +115,8 @@
<p class="text-center font-italic mb-5">
This post was originally published on
<a :href="post.meta.canonical_link" target="_blank" rel="noopener">{{
parseURL(post.meta.canonical_link).host
}}</a>
parseURL(post.meta.canonical_link).host
}}</a>
</p>
</div>
</div>
Expand All @@ -141,14 +141,14 @@ export default {
return {
title: this.post?.meta?.title,
meta: [
{ name: 'description', content: this.post?.meta?.description },
{ property: 'og:title', content: this.post?.meta?.title },
{ property: 'og:image', content: this.post?.featured_image },
{ property: 'og:description', content: this.post?.meta?.description },
{ name: 'description', content: this.post?.meta?.description || null },
{ property: 'og:title', content: this.post?.meta?.title || null },
{ property: 'og:image', content: this.post?.featured_image || null },
{ property: 'og:description', content: this.post?.meta?.description || null },
{ name: 'twitter:card', content: 'summary' },
{ name: 'twitter:title', content: this.post?.meta?.title },
{ name: 'twitter:description', content: this.post?.meta?.description },
{ name: 'twitter:image', content: this.post?.featured_image },
{ name: 'twitter:title', content: this.post?.meta?.title || null },
{ name: 'twitter:description', content: this.post?.meta?.description || null },
{ name: 'twitter:image', content: this.post?.featured_image || null },
],
};
},
Expand Down Expand Up @@ -212,7 +212,7 @@ export default {
NProgress.inc();
})
.catch(() => {
NProgress.done();
this.$router.push({ name: 'posts' });
});
},
},
Expand Down
2 changes: 1 addition & 1 deletion resources/js/ui/views/ShowTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default {
NProgress.inc();
})
.catch(() => {
NProgress.done();
this.$router.push({ name: 'tags' });
});
},
Expand Down
2 changes: 1 addition & 1 deletion resources/js/ui/views/ShowTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default {
NProgress.inc();
})
.catch(() => {
NProgress.done();
this.$router.push({ name: 'topics' });
});
},
Expand Down
2 changes: 1 addition & 1 deletion resources/js/ui/views/ShowUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default {
NProgress.inc();
})
.catch(() => {
NProgress.done();
this.$router.push({ name: 'posts' });
});
},
Expand Down
42 changes: 21 additions & 21 deletions resources/stubs/controllers/CanvasUiController.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use Illuminate\Pagination\LengthAwarePaginator;
class CanvasUiController extends Controller
{
/**
* @param Request $request
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View
*/
public function index(Request $request)
{
Expand All @@ -30,18 +30,18 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @return LengthAwarePaginator
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function getPosts(Request $request): LengthAwarePaginator
{
return Post::latest()->published()->with('user', 'topic')->paginate();
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $slug
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function showPost(Request $request, $slug): JsonResponse
{
Expand All @@ -57,7 +57,7 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @return string
*/
public function getTags(Request $request): string
Expand All @@ -66,9 +66,9 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $slug
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function showTag(Request $request, $slug): JsonResponse
{
Expand All @@ -78,9 +78,9 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $slug
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function getPostsForTag(Request $request, $slug): JsonResponse
{
Expand All @@ -90,7 +90,7 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @return string
*/
public function getTopics(Request $request): string
Expand All @@ -99,9 +99,9 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $slug
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function showTopic(Request $request, $slug): JsonResponse
{
Expand All @@ -111,9 +111,9 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $slug
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function getPostsForTopic(Request $request, $slug): JsonResponse
{
Expand All @@ -123,9 +123,9 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $id
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function showUser(Request $request, $id): JsonResponse
{
Expand All @@ -135,14 +135,14 @@ class CanvasUiController extends Controller
}

/**
* @param Request $request
* @param \Illuminate\Http\Request $request
* @param $id
* @return JsonResponse
* @return \Illuminate\Http\JsonResponse
*/
public function getPostsForUser(Request $request, $id): JsonResponse
{
$user = User::find($id);

return $user ? response()->json($user->posts()->published()->with('topic')->paginate(), 200) : response()->json(null, 200);
return $user ? response()->json($user->posts()->published()->with('user', 'topic')->paginate(), 200) : response()->json(null, 200);
}
}

0 comments on commit 5c1474a

Please sign in to comment.