Doceditor: Added filling session id

This commit is contained in:
Akmal Isomadinov 2024-07-18 16:03:18 +05:00
parent 5a3c98fa57
commit 271f4a7f87
3 changed files with 27 additions and 2 deletions

View File

@ -25,7 +25,15 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import { CompletedForm } from "@/components/completed-form";
async function Page() {
interface PageProps {
searchParams: Record<string, string | undefined>;
}
async function Page({ searchParams }: PageProps) {
const { share, fileId, fillingSessionId } = searchParams;
console.log({ share, fileId, fillingSessionId });
return <CompletedForm />;
}

View File

@ -58,6 +58,11 @@ type IConfigType = IConfig & {
onRequestStartFilling?: (event: object) => void;
onSubmit?: (event: object) => void;
};
editorConfig?: {
customization?: {
close?: Record<string, unknown>;
};
};
};
const Editor = ({
@ -307,8 +312,18 @@ const Editor = ({
newConfig.events.onSubmit = () => {
const origin = window.location.origin;
const otherSearchParams = new URLSearchParams();
if (config?.fillingSessionId)
otherSearchParams.append("fillingSessionId", config.fillingSessionId);
const combinedSearchParams = new URLSearchParams({
...Object.fromEntries(searchParams),
...Object.fromEntries(otherSearchParams),
});
window.location.replace(
`${origin}/doceditor/completed-form?${searchParams.toString()}`,
`${origin}/doceditor/completed-form?${combinedSearchParams.toString()}`,
);
};

View File

@ -182,6 +182,8 @@ export interface IInitialConfig {
errorMessage?: string;
message?: undefined;
startFilling?: boolean;
fillingSessionId?: string;
}
export type TError = {