refactor: update API endpoint paths to remove trailing slashes

- Modified various FastAPI route definitions to remove trailing slashes for consistency across the application.
- Updated corresponding fetch calls in the frontend to align with the new endpoint structure.
- Ensured that all affected routes maintain their functionality without trailing slashes.
This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-10-31 01:33:01 -07:00
parent 170b3cb167
commit ecd07d6155
41 changed files with 191 additions and 148 deletions

View file

@ -140,7 +140,7 @@ export default function ChatsPageClient({ searchSpaceId }: ChatsPageClientProps)
// Fetch all chats for this search space
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/chats/?search_space_id=${searchSpaceId}`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/chats?search_space_id=${searchSpaceId}`,
{
headers: {
Authorization: `Bearer ${token}`,
@ -285,7 +285,7 @@ export default function ChatsPageClient({ searchSpaceId }: ChatsPageClientProps)
};
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts/generate/`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts/generate`,
{
method: "POST",
headers: {

View file

@ -102,6 +102,9 @@ export default function BaiduSearchApiPage() {
config,
is_indexable: false,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -67,6 +67,9 @@ export default function ClickUpConnectorPage() {
CLICKUP_API_TOKEN: values.api_token,
},
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
};
await createConnector(connectorData, parseInt(searchSpaceId));

View file

@ -88,6 +88,9 @@ export default function ConfluenceConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -82,6 +82,9 @@ export default function DiscordConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -177,7 +177,10 @@ export default function ElasticsearchConnectorPage() {
name: values.name,
connector_type: EnumConnectorName.ELASTICSEARCH_CONNECTOR,
is_indexable: true,
search_space_id: searchSpaceIdNum,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
config,
};
@ -464,7 +467,7 @@ export default function ElasticsearchConnectorPage() {
<div className="rounded-lg border bg-muted/50 p-3">
<h4 className="text-sm font-medium mb-2">Selected Indices:</h4>
<div className="flex flex-wrap gap-2">
{stringToArray(form.watch("indices")).map((index) => (
{stringToArray(form.watch("indices") ?? "").map((index) => (
<Badge key={index} variant="secondary" className="text-xs">
{index}
</Badge>
@ -543,7 +546,7 @@ export default function ElasticsearchConnectorPage() {
<div className="rounded-lg border bg-muted/50 p-3">
<h4 className="text-sm font-medium mb-2">Search Fields:</h4>
<div className="flex flex-wrap gap-2">
{stringToArray(form.watch("search_fields")).map((field) => (
{stringToArray(form.watch("search_fields") ?? "").map((field) => (
<Badge key={field} variant="outline" className="text-xs">
{field}
</Badge>

View file

@ -107,7 +107,7 @@ export default function GithubConnectorPage() {
}
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/github/repositories/`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/github/repositories`,
{
method: "POST",
headers: {
@ -158,6 +158,9 @@ export default function GithubConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -101,6 +101,9 @@ export default function JiraConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -86,6 +86,9 @@ export default function LinearConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -74,6 +74,9 @@ export default function LinkupApiPage() {
},
is_indexable: false,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -99,6 +99,9 @@ export default function LumaConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -81,6 +81,9 @@ export default function NotionConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -122,6 +122,9 @@ export default function SearxngConnectorPage() {
config,
is_indexable: false,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -74,6 +74,9 @@ export default function SerperApiPage() {
},
is_indexable: false,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -81,6 +81,9 @@ export default function SlackConnectorPage() {
},
is_indexable: true,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -74,6 +74,9 @@ export default function TavilyApiPage() {
},
is_indexable: false,
last_indexed_at: null,
periodic_indexing_enabled: false,
indexing_frequency_minutes: null,
next_scheduled_at: null,
},
parseInt(searchSpaceId)
);

View file

@ -64,7 +64,7 @@ export default function WebpageCrawler() {
// Make API call to backend
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/documents/`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/documents`,
{
method: "POST",
headers: {

View file

@ -73,7 +73,7 @@ export default function YouTubeVideoAdder() {
// Make API call to backend
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/documents/`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/documents`,
{
method: "POST",
headers: {

View file

@ -130,7 +130,7 @@ export default function PodcastsPageClient({ searchSpaceId }: PodcastsPageClient
// Fetch all podcasts for this search space
const response = await fetch(
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts/`,
`${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/api/v1/podcasts`,
{
headers: {
Authorization: `Bearer ${token}`,