mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-14 10:34:06 +02: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'
|
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.
|
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.
|
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:
|
mobileScannerSettings:
|
||||||
convertToPdf: true # Automatically convert uploaded images to PDF format. If false, images are kept as-is.
|
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.
|
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);
|
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:
|
case SPLIT_METHODS.BY_PAGES:
|
||||||
formData.append("pageNumbers", parameters.pages);
|
formData.append("pageNumbers", parameters.pages);
|
||||||
break;
|
break;
|
||||||
@@ -52,13 +55,18 @@ export const buildSplitFormData = (parameters: SplitParameters, file: File): For
|
|||||||
formData.append("rightToLeft", (parameters.rightToLeft ?? false).toString());
|
formData.append("rightToLeft", (parameters.rightToLeft ?? false).toString());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unknown split method: ${parameters.method}`);
|
throw new Error(`Unknown split method: ${method}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return formData;
|
return formData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSplitEndpoint = (parameters: SplitParameters): string => {
|
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) {
|
switch (parameters.method) {
|
||||||
case SPLIT_METHODS.BY_PAGES:
|
case SPLIT_METHODS.BY_PAGES:
|
||||||
return "/api/v1/general/split-pages";
|
return "/api/v1/general/split-pages";
|
||||||
|
|||||||
Reference in New Issue
Block a user