@bluecopa/core 0.1.28 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Form } from './getFormById';
|
|
2
2
|
export interface CreateOrUpdateFormRequest {
|
|
3
3
|
data: Form;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
processSheetId: string;
|
|
5
|
+
formInstanceId: string;
|
|
6
|
+
isDummy: boolean;
|
|
7
|
+
status: "DRAFTED" | "PUBLISHED";
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* Creates or updates a form
|
|
@@ -12,4 +13,4 @@ export interface CreateOrUpdateFormResponse {
|
|
|
12
13
|
* @returns Promise<Form> The created or updated form
|
|
13
14
|
* @throws Error if the request fails
|
|
14
15
|
*/
|
|
15
|
-
export declare function createOrUpdateForm({ data, }: CreateOrUpdateFormRequest): Promise<Form>;
|
|
16
|
+
export declare function createOrUpdateForm({ data, processSheetId, formInstanceId, isDummy, status, }: CreateOrUpdateFormRequest): Promise<Form>;
|
package/dist/index.es.js
CHANGED
|
@@ -6890,7 +6890,11 @@ async function getFormById({
|
|
|
6890
6890
|
}
|
|
6891
6891
|
}
|
|
6892
6892
|
async function createOrUpdateForm({
|
|
6893
|
-
data
|
|
6893
|
+
data,
|
|
6894
|
+
processSheetId,
|
|
6895
|
+
formInstanceId,
|
|
6896
|
+
isDummy,
|
|
6897
|
+
status
|
|
6894
6898
|
}) {
|
|
6895
6899
|
var _a, _b, _c;
|
|
6896
6900
|
try {
|
|
@@ -6898,16 +6902,20 @@ async function createOrUpdateForm({
|
|
|
6898
6902
|
throw { message: "Form data is required", status: 400 };
|
|
6899
6903
|
}
|
|
6900
6904
|
const response = await apiClient.post("/form/create-or-update-form", {
|
|
6901
|
-
data
|
|
6905
|
+
data,
|
|
6906
|
+
processSheetId,
|
|
6907
|
+
formInstanceId,
|
|
6908
|
+
isDummy,
|
|
6909
|
+
status
|
|
6902
6910
|
});
|
|
6903
|
-
if (!response.data
|
|
6911
|
+
if (!response.data) {
|
|
6904
6912
|
throw { message: "Failed to create or update form", status: 500 };
|
|
6905
6913
|
}
|
|
6906
6914
|
return response.data.data;
|
|
6907
6915
|
} catch (error) {
|
|
6908
6916
|
const message = ((_b = (_a = error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || error.message || "An unexpected error occurred while creating or updating form";
|
|
6909
|
-
const
|
|
6910
|
-
throw { message, status };
|
|
6917
|
+
const status2 = ((_c = error.response) == null ? void 0 : _c.status) || 500;
|
|
6918
|
+
throw { message, status: status2 };
|
|
6911
6919
|
}
|
|
6912
6920
|
}
|
|
6913
6921
|
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|