Skip to content

Commit

Permalink
fix: API "regression"
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Feb 26, 2021
1 parent 128be66 commit 59d4225
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion store/booru.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ export const actions = {
}
},

// TODO: This should be handled by an API library
createApiUrl(context, { mode, postID, tag }) {
const { getters, rootState } = context

Expand All @@ -292,7 +293,7 @@ export const actions = {
id: postID,
},

tags: { tag, limit: 15 },
tags: { tag, limit: 15, order: 'count' },
}

const urlToFetch = new URL(
Expand Down Expand Up @@ -323,6 +324,10 @@ export const actions = {
case 'tags':
urlToFetch.searchParams.append('tag', queries.tags.tag)

if (queries.tags.order) {
urlToFetch.searchParams.append('order', queries.tags.order)
}

if (queries.tags.limit) {
urlToFetch.searchParams.append('limit', queries.tags.limit)
}
Expand Down

0 comments on commit 59d4225

Please sign in to comment.