feat: migrate createLLMConfig to jotai mutation atom and add query atoms for LLM configs

This commit is contained in:
CREDO23 2025-12-09 19:39:25 +00:00
parent 0c0491cd49
commit 5b7e5770be
6 changed files with 93 additions and 71 deletions

View file

@ -2,6 +2,7 @@
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { authenticatedFetch } from "@/lib/auth-utils";
import { UpdateLLMConfigRequest } from "@/contracts/types/llm-config.types";
export interface LLMConfig {
id: number;
@ -136,7 +137,7 @@ export function useLLMConfigs(searchSpaceId: number | null) {
const updateLLMConfig = async (
id: number,
config: UpdateLLMConfig
config: UpdateLLMConfigRequest["data"]
): Promise<LLMConfig | null> => {
try {
const response = await authenticatedFetch(