Skip to content

Commit

Permalink
Merge pull request #344 from ertush/hotfix
Browse files Browse the repository at this point in the history
Tested and Merged Fix for FacilityType and FacilityTypeDetails Fields…
  • Loading branch information
ertush authored Mar 13, 2024
2 parents 903ebf9 + d0fbb07 commit 2d0c2fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
pnpm-lock.yaml
yarn.lock

# local env files
Expand Down
8 changes: 5 additions & 3 deletions components/Forms/BasicDetailsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ export function BasicDeatilsForm({ editMode }) {

updateFacilityTypeDetailOptions()

function getFacilityTypeDetails_parent(facilityTypeId, token) {
function getFacilityTypeDetailsParent(facilityTypeId, token) {

return fetch(`${process.env.NEXT_PUBLIC_API_URL}/facilities/facility_types_details/?id=${facilityTypeId}`, {
headers: {
Expand All @@ -590,6 +590,8 @@ export function BasicDeatilsForm({ editMode }) {
.catch(console.error)

}


function getFacilityTypeDetails(facilityTypeId, token) {

return fetch(`${process.env.NEXT_PUBLIC_API_URL}/facilities/facility_types_details/?is_parent=false&parent=${facilityTypeId}`, {
Expand Down Expand Up @@ -640,8 +642,8 @@ export function BasicDeatilsForm({ editMode }) {

}
else if (editMode) {
var parent="";
getFacilityTypeDetails_parent(options?.data?.facility_type, options?.token)
let parent = "";
getFacilityTypeDetailsParent(options?.data?.facility_type, options?.token)
.then(facilityTypeDetails => {

parent=facilityTypeDetails[0]?.parent;
Expand Down

0 comments on commit 2d0c2fa

Please sign in to comment.