Skip to content

Commit

Permalink
fix(web): update laf ai request url (#1223)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ authored Jun 6, 2023
1 parent 9854b84 commit 060a393
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion web/src/components/ChargeButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export default function ChargeButton(props: { amount?: number; children: React.R
variant={"outline"}
key={item}
onClick={() => {
console.log(123, item);
setAmount(item / 100);
}}
>
Expand Down
2 changes: 2 additions & 0 deletions web/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ export const COLOR_MODE = {
light: "light",
dark: "dark",
};

export const LAF_AI_URL = "https://htr4n1.laf.run/laf-gpt";
3 changes: 2 additions & 1 deletion web/src/pages/app/functions/mods/AIChatPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { v4 as uuidv4 } from "uuid";

import { LafAILogoIcon } from "@/components/CommonIcon";
import Markdown from "@/components/Markdown";
import { LAF_AI_URL } from "@/constants";

export default function AIChatPanel() {
const { t } = useTranslation();
Expand Down Expand Up @@ -75,7 +76,7 @@ export default function AIChatPanel() {
const { data: generateCodeRes, ...generateCode } = useMutation((params: any) => {
inputRef.current?.focus();
return axios({
url: "https://itceb8.laf.run/laf-gpt",
url: LAF_AI_URL,
method: "POST",
data: params,
cancelToken: source.token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import axios from "axios";
import CodeViewer from "@/components/Editor/CodeViewer";
// import FunctionEditor from "@/components/Editor/FunctionEditor";
import InputTag from "@/components/InputTag";
import { SUPPORTED_METHODS } from "@/constants";
import { LAF_AI_URL, SUPPORTED_METHODS } from "@/constants";

import { useCreateFunctionMutation, useUpdateFunctionMutation } from "../../../service";
import useFunctionStore from "../../../store";
Expand Down Expand Up @@ -59,7 +59,7 @@ const PromptModal = (props: {

const { data: generateCodeRes, ...generateCode } = useMutation((params: any) => {
return axios({
url: "https://itceb8.laf.run/laf-gpt",
url: LAF_AI_URL,
method: "POST",
data: params,
cancelToken: source.token,
Expand Down

0 comments on commit 060a393

Please sign in to comment.