fix: add group id field to ApiKeyModal #1353 (#1540)

### What problem does this PR solve?

fix: add group id field to ApiKeyModal #1353
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-07-17 09:45:10 +08:00
committed by GitHub
parent 00943dc04a
commit baeedc699d
3 changed files with 17 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import {
} from '@/hooks/userSettingHook';
import { IAddLlmRequestBody } from '@/interfaces/request/llm';
import { useCallback, useEffect, useState } from 'react';
import { ApiKeyPostBody } from '../interface';
type SavingParamsState = Omit<IApiKeySavingParams, 'api_key'>;
@ -31,11 +32,10 @@ export const useSubmitApiKey = () => {
} = useSetModalState();
const onApiKeySavingOk = useCallback(
async (apiKey: string, baseUrl: string) => {
async (postBody: ApiKeyPostBody) => {
const ret = await saveApiKey({
...savingParams,
api_key: apiKey,
base_url: baseUrl,
...postBody,
});
if (ret === 0) {