feat: add image uploader in edit chunk dialog (#12003)

### What problem does this PR solve?

Add image uploader in edit chunk dialog for replacing image chunk

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Jimmy Ben Klieve
2025-12-18 09:33:52 +08:00
committed by GitHub
parent 672958a192
commit ce161f09cc
5 changed files with 87 additions and 14 deletions

View File

@ -7,10 +7,16 @@ export const isFormData = (data: unknown): data is FormData => {
return data instanceof FormData;
};
const excludedFields = ['img2txt_id', 'mcpServers'];
const excludedFields: Array<string | RegExp> = [
'img2txt_id',
'mcpServers',
'image_base64',
];
const isExcludedField = (key: string) => {
return excludedFields.includes(key);
return excludedFields.some((excl) =>
excl instanceof RegExp ? excl.test(key) : excl === key,
);
};
export const convertTheKeysOfTheObjectToSnake = (data: unknown) => {