Skip to content

Commit

Permalink
fix: relative/absolute url patch for vector count
Browse files Browse the repository at this point in the history
connect #516
  • Loading branch information
timothycarambat committed Jan 11, 2024
1 parent dfd03e3 commit 4af9b9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/models/system.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { API_BASE, AUTH_TIMESTAMP } from "@/utils/constants";
import { API_BASE, AUTH_TIMESTAMP, fullApiUrl } from "@/utils/constants";
import { baseHeaders } from "@/utils/request";
import DataConnector from "./dataConnector";

Expand All @@ -10,7 +10,7 @@ const System = {
.catch(() => false);
},
totalIndexes: async function (slug = null) {
const url = new URL(`${API_BASE}/system/system-vectors`);
const url = new URL(`${fullApiUrl()}/system/system-vectors`);
if (!!slug) url.searchParams.append("slug", encodeURIComponent(slug));
return await fetch(url.toString(), {
headers: baseHeaders(),
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ export const COMPLETE_QUESTIONNAIRE = "anythingllm_completed_questionnaire";

export const USER_BACKGROUND_COLOR = "bg-historical-msg-user";
export const AI_BACKGROUND_COLOR = "bg-historical-msg-system";

export function fullApiUrl() {
if (API_BASE !== "/api") return API_BASE;
return `${window.location.origin}/api`;
}

0 comments on commit 4af9b9d

Please sign in to comment.