Skip to content

Commit

Permalink
use correct apiUrl constant in frontend + remove unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shatfield4 committed Aug 22, 2024
1 parent c0a2610 commit ae12f5b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
1 change: 0 additions & 1 deletion embed
Submodule embed deleted from 22a084
5 changes: 2 additions & 3 deletions extension/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "extension",
"private": true,
"version": "0.0.0",
"name": "anything-llm-extension",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "nodemon --watch src --watch public -e js,jsx,css,html --exec \"yarn dev:build\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { X } from "@phosphor-icons/react";
import BrowserExtensionApiKey from "@/models/browserExtensionApiKey";
import { API_BASE } from "@/utils/constants";
import { fullApiUrl } from "@/utils/constants";

export default function NewBrowserExtensionApiKeyModal({
closeModal,
Expand All @@ -18,7 +18,7 @@ export default function NewBrowserExtensionApiKeyModal({
const { apiKey: newApiKey, error } =
await BrowserExtensionApiKey.generateKey();
if (!!newApiKey) {
const fullApiKey = `${API_BASE}|${newApiKey}`;
const fullApiKey = `${fullApiUrl()}|${newApiKey}`;
setApiKey(fullApiKey);
onSuccess();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CTAButton from "@/components/lib/CTAButton";
import NewBrowserExtensionApiKeyModal from "./NewBrowserExtensionApiKeyModal";
import ModalWrapper from "@/components/ModalWrapper";
import { useModal } from "@/hooks/useModal";
import { API_BASE } from "@/utils/constants";
import { fullApiUrl } from "@/utils/constants";

export default function BrowserExtensionApiKeys() {
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -101,7 +101,7 @@ export default function BrowserExtensionApiKeys() {
key={apiKey.key}
apiKey={apiKey}
removeApiKey={removeApiKey}
connectionString={`${API_BASE}|${apiKey.key}`}
connectionString={`${fullApiUrl()}|${apiKey.key}`}
/>
))
)}
Expand Down
3 changes: 0 additions & 3 deletions server/endpoints/browserExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ function browserExtensionEndpoints(app) {
[validBrowserExtensionApiKey],
async (request, response) => {
try {
// const auth = request.header("Authorization");
// const bearerKey = auth ? auth.split(" ")[1] : null;
// const apiKey = await BrowserExtensionApiKey.get({ key: bearerKey });
const workspaces = await Workspace.where();
response.status(200).json({
connected: true,
Expand Down

0 comments on commit ae12f5b

Please sign in to comment.