mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
fix split cuased by defaultParameters breaking dynamic endpoint tools (#5838)
This commit is contained in:
@@ -173,7 +173,7 @@ system:
|
||||
corsAllowedOrigins: [] # List of allowed origins for CORS (e.g. ['http://localhost:5173', 'https://app.example.com']). Leave empty to disable CORS. For local development with frontend on port 5173, add 'http://localhost:5173'
|
||||
backendUrl: "" # Backend base URL for SAML/OAuth/API callbacks (e.g. 'http://localhost:8080' for dev, 'https://api.example.com' for production). REQUIRED for SSO authentication to work correctly. This is where your IdP will send SAML responses and OAuth callbacks. Leave empty to default to 'http://localhost:8080' in development.
|
||||
frontendUrl: "" # Frontend URL for invite email links (e.g. 'https://app.example.com'). Optional - if not set, will use backendUrl. This is the URL users click in invite emails.
|
||||
enableMobileScanner: false # Enable mobile phone QR code upload feature. Requires frontendUrl to be configured.
|
||||
enableMobileScanner: true # Enable mobile phone QR code upload feature. Requires frontendUrl to be configured.
|
||||
mobileScannerSettings:
|
||||
convertToPdf: true # Automatically convert uploaded images to PDF format. If false, images are kept as-is.
|
||||
imageResolution: full # Image resolution for mobile uploads: 'full' (original size) or 'reduced' (max 1200px on longest side). Only applies when convertToPdf is true.
|
||||
|
||||
@@ -12,7 +12,10 @@ export const buildSplitFormData = (parameters: SplitParameters, file: File): For
|
||||
|
||||
formData.append("fileInput", file);
|
||||
|
||||
switch (parameters.method) {
|
||||
// Use BY_PAGES as default if no method is selected
|
||||
const method = parameters.method || SPLIT_METHODS.BY_PAGES;
|
||||
|
||||
switch (method) {
|
||||
case SPLIT_METHODS.BY_PAGES:
|
||||
formData.append("pageNumbers", parameters.pages);
|
||||
break;
|
||||
@@ -52,13 +55,18 @@ export const buildSplitFormData = (parameters: SplitParameters, file: File): For
|
||||
formData.append("rightToLeft", (parameters.rightToLeft ?? false).toString());
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown split method: ${parameters.method}`);
|
||||
throw new Error(`Unknown split method: ${method}`);
|
||||
}
|
||||
|
||||
return formData;
|
||||
};
|
||||
|
||||
export const getSplitEndpoint = (parameters: SplitParameters): string => {
|
||||
// Default to BY_PAGES endpoint if no method selected yet
|
||||
if (!parameters.method) {
|
||||
return "/api/v1/general/split-pages";
|
||||
}
|
||||
|
||||
switch (parameters.method) {
|
||||
case SPLIT_METHODS.BY_PAGES:
|
||||
return "/api/v1/general/split-pages";
|
||||
|
||||
Reference in New Issue
Block a user