Skip to content

Commit

Permalink
Merge pull request AOT-Technologies#2254 from abilpraju-aot/bugfix/FW…
Browse files Browse the repository at this point in the history
…F-3641-form-validation-api

validation api on form create and duplicate
  • Loading branch information
arun-s-aot authored Oct 14, 2024
2 parents 47e4ff2 + 232315f commit 35afacd
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 85 deletions.
2 changes: 1 addition & 1 deletion forms-flow-web-root-config/public/config/config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
window["_env_"] = {};
window["_env_"] = {};
1 change: 1 addition & 0 deletions forms-flow-web-root-config/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/assets/dmn-font/css/dmn.css">
<link rel="stylesheet" href="https://forms-flow-microfrontends.aot-technologies.com/[email protected]/forms-flow-theme.min.css">


<!-- required styles from cdn -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/formio.full.min.css">
Expand Down
1 change: 1 addition & 0 deletions forms-flow-web/src/apiManager/endpoints/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const API = {
GET_FILTERS : `${WEB_BASE_URL}/filter`,
GET_BPM_TASK_FILTERS : `${BPM_BASE_URL_EXT}/v1/task-filters`,
VALIDATE_TENANT: `${MT_ADMIN_BASE_URL}/${MT_ADMIN_BASE_URL_VERSION}/tenants/<tenant_id>/validate`,
VALIDATE_FORM_NAME: `${WEB_BASE_URL}/form/validate`
};

export default API;
12 changes: 11 additions & 1 deletion forms-flow-web/src/apiManager/services/FormServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const formCreate = (formData) => {
};

export const formImport = (importData, data) => {
console.log("reached back", importData, data);
return RequestService.httpMultipartPOSTRequest(API.FORM_IMPORT, importData, data);
};

Expand Down Expand Up @@ -72,3 +71,14 @@ export const getCustomSubmission = (submissionId, formId, ...rest) => {
});
};
};

export const validateFormName = (title, name, id) => {
let url = `${API.VALIDATE_FORM_NAME}?title=${title}`;
if (name) {
url += `&name=${encodeURIComponent(name)}`;
}
if (id) {
url += `&id=${encodeURIComponent(id)}`;
}
return RequestService.httpGETRequest(url);
};
Loading

0 comments on commit 35afacd

Please sign in to comment.