This commit is contained in:
ducklet 2021-08-05 17:50:44 +02:00
parent 9acd534706
commit 0532676fa4
4 changed files with 13 additions and 11 deletions

View file

@ -11,7 +11,9 @@
<div class="select is-small">
<select v-model="filter_group" @change="search">
<option selected value="">Me ({{ login_user.name }})</option>
<option v-for="g in login_user.groups" :value="g.id">{{g.id}}</option>
<option v-for="g in login_user.groups" :key="g.id" :value="g.id">
{{ g.id }}
</option>
</select>
</div>
<div class="icon is-small is-left">
@ -34,7 +36,7 @@
<span class="select">
<select v-model="media_type" @change="search">
<option value="">(any type)</option>
<option v-for="t in media_types" :value="t">{{ t }}</option>
<option v-for="t in media_types" :key="t" :value="t">{{ t }}</option>
</select>
</span>
</p>
@ -163,9 +165,9 @@ const debounced_get = debounce_async(100, get)
type ULID = string
type User = {
id: ULID,
name: string,
groups: Array<{id: ULID}>,
id: ULID
name: string
groups: Array<{ id: ULID }>
}
export default defineComponent({
@ -179,7 +181,7 @@ export default defineComponent({
media_types,
media_type: "",
active: false,
filter_group: '',
filter_group: "",
}),
mounted() {
const { query, type } = view_params()
@ -209,7 +211,7 @@ export default defineComponent({
const per_page = 100
const media_type = this.media_type === "" ? null : this.media_type
const user_id = this.filter_group === '' && this.credentials.user_id || null
const user_id = (this.filter_group === "" && this.credentials.user_id) || null
const group_id = user_id === null && this.filter_group ? this.filter_group : null
const more = await debounced_get(
"movies",