Refactor BaseUrl string conversion

We're only using this as a string, so no need to convert it to an URL.
This commit is contained in:
Rūdolfs Ošiņš
2024-02-23 15:46:28 +00:00
parent 8f43a57984
commit 41435951c1
8 changed files with 21 additions and 24 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import type { ErrorRoute, NotFoundRoute } from "@app/lib/router/definitions";
import type { ProjectRoute } from "@app/views/projects/router";
import { baseUrlToUrl, isLocal } from "@app/lib/utils";
import { baseUrlToString, isLocal } from "@app/lib/utils";
import { ResponseParseError, ResponseError } from "@httpd-client/lib/fetcher";
import { httpdStore } from "@app/lib/httpd";
import { get } from "svelte/store";
@@ -10,7 +10,7 @@ export function handleError(
error: Error | ResponseParseError | ResponseError,
route: ProjectRoute,
): NotFoundRoute | ErrorRoute {
const url = baseUrlToUrl(route.node);
const url = baseUrlToString(route.node);
if (error instanceof ResponseError && error.status === 404) {
let subject;