fix: Trim trailing slash in Universal Inbox URL

This commit is contained in:
2024-04-29 17:29:37 +02:00
parent a8cf51ec4a
commit 735b2f5481
6 changed files with 12 additions and 12 deletions

View File

@@ -39,7 +39,7 @@ export function PlanTask({ notification, mutate }: PlanTaskProps) {
const [searchText, setSearchText] = useState("");
const { isLoading, data: projects } = useFetch<Array<ProjectSummary>>(
`${preferences.universalInboxBaseUrl}/api/tasks/projects/search?matches=${searchText}`,
`${preferences.universalInboxBaseUrl.replace(/\/$/, "")}/api/tasks/projects/search?matches=${searchText}`,
{
keepPreviousData: true,
headers: {
@@ -122,7 +122,7 @@ async function planTask(
try {
await mutate(
handleErrors(
fetch(`${preferences.universalInboxBaseUrl}/api/tasks/${notification.task.id}`, {
fetch(`${preferences.universalInboxBaseUrl.replace(/\/$/, "")}/api/tasks/${notification.task.id}`, {
method: "PATCH",
body: JSON.stringify({
project: taskPlanning.project.name,