fix(ocr): include id in provider config update request

The id parameter was missing in the update request body, causing potential issues with identifying which provider to update. Add id to the request body to ensure correct provider is updated.
This commit is contained in:
icarus 2025-10-20 08:39:46 +08:00
parent 8aaf26e420
commit 46772b4f2a

View File

@ -17,12 +17,12 @@ export const useOcrProvider = (id: string) => {
const updateConfig = useCallback(
async (update: Partial<OcrProviderConfig>) => {
try {
await mutate({ body: update })
await mutate({ body: { id, config: update } })
} catch (e) {
window.toast.error({ title: t('ocr.provider.config.patch.error.failed'), description: getErrorMessage(e) })
}
},
[mutate, t]
[id, mutate, t]
)
return {