Fix remote search

environments/review-front-deve-otr6gc/deployments/13419
Kasper Seweryn 2022-09-07 13:10:22 +00:00 zatwierdzone przez Ciarán Ainsworth
rodzic 37278348fb
commit 778d2fcbd4
3 zmienionych plików z 11 dodań i 8 usunięć

Wyświetl plik

@ -350,7 +350,7 @@ def fetch(fetch_obj):
return error(
"http",
status_code=e.response.status_code if e.response else None,
message=response.text,
message=e.response.text,
)
except requests.exceptions.Timeout:
return error("timeout")

Wyświetl plik

@ -0,0 +1 @@
Fix remote search (#1857)

Wyświetl plik

@ -1,11 +1,14 @@
<script setup lang="ts">
import type { BackendError } from '~/types'
import axios from 'axios'
import { useStore } from '~/store'
import { ref, computed, watch, watchEffect } from 'vue'
import { useRouter } from 'vue-router'
import { useGettext } from 'vue3-gettext'
import { useRouter } from 'vue-router'
import { useStore } from '~/store'
import axios from 'axios'
import updateQueryString from '~/composables/updateQueryString'
type Type = 'rss' | 'artists' | 'both'
@ -99,10 +102,10 @@ const submit = () => {
const isLoading = ref(false)
const createFetch = async () => {
console.log(id.value, props.standalone)
if (!id.value) return
if (props.standalone) {
// TODO (wvffle): Check if this needs to be handled
return router.replace({ name: 'search', query: { id: id.value } })
history.replaceState(history.state, '', updateQueryString(location.href, 'id', id.value))
}
obj.value = undefined
@ -128,8 +131,7 @@ const store = useStore()
const rssSubscribe = async () => {
if (!id.value) return
if (props.standalone) {
// TODO (wvffle): Check if this needs to be handled
return router.replace({ name: 'search', query: { id: id.value, type: 'rss' } })
history.replaceState(history.state, '', updateQueryString(location.href, 'id', id.value))
}
obj.value = undefined