mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-18 01:19:24 +00:00
change requests
This commit is contained in:
parent
792140a36f
commit
2302949856
@ -22,17 +22,9 @@ export const removePagesOperationConfig = {
|
|||||||
|
|
||||||
export const useRemovePagesOperation = () => {
|
export const useRemovePagesOperation = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// const { extractZipFiles } = useToolResources();
|
|
||||||
|
|
||||||
const responseHandler = useCallback(async (blob: Blob, originalFiles: File[]): Promise<File[]> => {
|
|
||||||
// Backend returns a PDF for remove-pages
|
|
||||||
const base = originalFiles[0]?.name?.replace(/\.[^.]+$/, '') || 'document';
|
|
||||||
return [new File([blob], `removed_pages_${base}.pdf`, { type: 'application/pdf' })];
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return useToolOperation<RemovePagesParameters>({
|
return useToolOperation<RemovePagesParameters>({
|
||||||
...removePagesOperationConfig,
|
...removePagesOperationConfig,
|
||||||
responseHandler,
|
|
||||||
getErrorMessage: createStandardErrorHandler(
|
getErrorMessage: createStandardErrorHandler(
|
||||||
t('removePages.error.failed', 'Failed to remove pages')
|
t('removePages.error.failed', 'Failed to remove pages')
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user