Skip to content

Commit

Permalink
feat: support filters
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jun 7, 2023
1 parent 4b5327f commit ca7ee0e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions assets/js/RouterHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import Tag from 'assets/js/tag.dto'
import { RouteLocationRaw } from 'vue-router'

export function generatePostsRoute(
domain: string | undefined | null,
page: number | undefined | null,
tags: Tag[] | undefined | null
domain?: string | undefined | null,
page?: number | undefined | null,
tags?: Tag[] | undefined | null,
filters?: Object | undefined | null
) {
const route: RouteLocationRaw = {
path: '/posts',
Expand All @@ -23,5 +24,9 @@ export function generatePostsRoute(
route.query.tags = tags.map((tag) => encodeURI(tag.name)).join('|')
}

if (filters != null) {
route.query.filter = filters
}

return route
}

0 comments on commit ca7ee0e

Please sign in to comment.