Skip to content

Commit 8dee676

Browse files
committed
search: update URL with selected query params, improve logic loading those values
1 parent 00bbcfd commit 8dee676

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pages/search.vue

+9-8
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ useHead({
6969
</div>
7070
</div>
7171
</div>
72+
<br />
7273
<div v-if="entries != null">
73-
<h5>Results</h5>
74+
<h5>{{ entries.length }} Results</h5>
7475
<div v-if="entries.length == 0">
7576
Welp, it looks like there are no results matching your query
7677
</div>
@@ -112,7 +113,7 @@ export default {
112113
if (this.textQuery) {
113114
params["q"] = this.textQuery;
114115
}
115-
let url = baseurl + new URLSearchParams({ results: 1000, ...params });
116+
let url = baseurl + new URLSearchParams({ results: 10000, ...params });
116117
117118
fetch(url).then((response) => {
118119
let gameblob = response.json().then((data) => {
@@ -139,17 +140,17 @@ export default {
139140
};
140141
}
141142
}
142-
if (this.$route.query.type) {
143+
if (this.$route.query.typetag) {
143144
if (
144145
["all", "game", "demo", "music", "tool"].includes(
145-
this.$route.query.type.toLowerCase(),
146+
this.$route.query.typetag.toLowerCase(),
146147
)
147148
) {
148149
this.selectedType = {
149150
name:
150-
this.$route.query.type.charAt(0).toUpperCase() +
151-
this.$route.query.type.slice(1),
152-
code: this.$route.query.type.toLowerCase(),
151+
this.$route.query.typetag.charAt(0).toUpperCase() +
152+
this.$route.query.typetag.slice(1),
153+
code: this.$route.query.typetag.toLowerCase(),
153154
};
154155
}
155156
}
@@ -176,7 +177,7 @@ export default {
176177
{ name: "Game", code: "game" },
177178
{ name: "Demo", code: "demo" },
178179
{ name: "Music", code: "music" },
179-
{ name: "Tool", code: "homebrew" },
180+
{ name: "Tool", code: "tool" },
180181
],
181182
selectedTags: null,
182183
groupedCities: [

0 commit comments

Comments
 (0)