From 3a57c9f0049ac7afefbfce2a84ae455521a41062 Mon Sep 17 00:00:00 2001 From: tombch Date: Tue, 2 Jul 2024 11:10:26 +0100 Subject: [PATCH] Add trailing slashes to prevent unnecessary 301 redirects --- lib/Onyx.tsx | 10 +++++----- lib/components/Header.tsx | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Onyx.tsx b/lib/Onyx.tsx index 5685bc0..1fabd99 100644 --- a/lib/Onyx.tsx +++ b/lib/Onyx.tsx @@ -23,7 +23,7 @@ import LoadingAlert from "./components/LoadingAlert"; import "./Onyx.css"; import "./bootstrap.css"; -const VERSION = "0.10.1"; +const VERSION = "0.10.2"; type ProjectField = { type: string; @@ -481,7 +481,7 @@ function App(props: OnyxProps) { queryKey: ["projects"], queryFn: async () => { return props - .httpPathHandler("projects") + .httpPathHandler("projects/") .then((response) => response.json()) .then((data) => { return [ @@ -507,7 +507,7 @@ function App(props: OnyxProps) { queryKey: ["types"], queryFn: async () => { return props - .httpPathHandler("projects/types") + .httpPathHandler("projects/types/") .then((response) => response.json()) .then((data) => { return new Map( @@ -525,7 +525,7 @@ function App(props: OnyxProps) { queryKey: ["lookups"], queryFn: async () => { return props - .httpPathHandler("projects/lookups") + .httpPathHandler("projects/lookups/") .then((response) => response.json()) .then((data) => { return new Map( @@ -549,7 +549,7 @@ function App(props: OnyxProps) { queryKey: ["fields", project], queryFn: async () => { return props - .httpPathHandler("projects/" + project + "/fields") + .httpPathHandler("projects/" + project + "/fields/") .then((response) => response.json()) .then((data) => { const fields = flattenFields(data.data.fields); diff --git a/lib/components/Header.tsx b/lib/components/Header.tsx index cbd8d25..0b37c00 100644 --- a/lib/components/Header.tsx +++ b/lib/components/Header.tsx @@ -48,7 +48,7 @@ function Header(props: HeaderProps) { queryKey: ["profile"], queryFn: async () => { return props - .httpPathHandler("accounts/profile") + .httpPathHandler("accounts/profile/") .then((response) => response.json()) .then((data) => { return { username: data.data.username, site: data.data.site }; diff --git a/package.json b/package.json index 808204a..a88626b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "climb-onyx-gui", - "version": "0.10.1", + "version": "0.10.2", "type": "module", "main": "dist/climb-onyx-gui.js", "types": "dist/main.d.ts",