Skip to content

Commit

Permalink
Fix posts by tag API
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Jun 27, 2024
1 parent c4fa864 commit 14a3435
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-backend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: DeployBackendProd
on:
push:
branches:
- "use-nuxt-image-to-show-images"
- "master"

jobs:
deploy-backend-prod:
Expand Down
6 changes: 3 additions & 3 deletions nuxt-frontend/components/partials/NewHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ export default {
methods: {
handleScroll() {
let scrollY = this.podcastRef
? this.podcastRef.scrollTop
: window.scrollY;
? this.podcastRef.scrollTop
: window.scrollY;
let pageYOffset = this.podcastRef ? scrollY : window.pageYOffset;
let scrollUp = this.lastScrollY > scrollY && pageYOffset > 100;
this.showNavbar = scrollUp || (this.showNavbar && pageYOffset > 0);
Expand All @@ -286,7 +286,7 @@ export default {
// Check if any child URL matches
if (navbar.subMenus) {
return navbar.subMenus.some(
(subMenu) => this.$route.path === subMenu.url
(subMenu) => this.$route.path === subMenu.url,
);
}
Expand Down
6 changes: 3 additions & 3 deletions post/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func (repository *Repository) GetPostsByTag(c *gin.Context) {

posts := []Post{}
err = repository.Db.Select(&posts, `SELECT id, title, slug, tags as tag, is_featured, is_published, published_on, published_at, reading_time, summary
FROM posts
WHERE `+query+` tags @> $1`, `[{"slug": "`+slug+`"}]
ORDER BY published_on DESC`)
FROM posts
WHERE `+query+` tags @> $1
ORDER BY published_on DESC`, `[{"slug": "`+slug+`"}]`)
if err != nil {
log.Error("Error while fetching posts: ", err)
c.AbortWithStatus(http.StatusInternalServerError)
Expand Down

0 comments on commit 14a3435

Please sign in to comment.