Standalone raw file redirects (#428)

This commit is contained in:
Spencer Woo
2022-02-14 19:33:19 +08:00
committed by GitHub
parent 0fda1c93db
commit 9493ce9f3d
30 changed files with 365 additions and 185 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ function mapAbsolutePath(path: string): string {
function useDriveItemSearch() {
const [query, setQuery] = useState('')
const searchDriveItem = async (q: string) => {
const { data } = await axios.get<OdSearchResult>(`/api/search?q=${q}`)
const { data } = await axios.get<OdSearchResult>(`/api/search/?q=${q}`)
// Map parentReference to the absolute path of the search result
data.map(item => {
@@ -111,7 +111,7 @@ function SearchResultItemTemplate({
}
function SearchResultItemLoadRemote({ result }: { result: OdSearchResult[number] }) {
const { data, error }: SWRResponse<OdDriveItem, string> = useSWR(`/api/item?id=${result.id}`, fetcher)
const { data, error }: SWRResponse<OdDriveItem, string> = useSWR(`/api/item/?id=${result.id}`, fetcher)
const { t } = useTranslation()