Skip to content

Commit

Permalink
Merge pull request AOT-Technologies#2266 from auslin-aot/feature/incl…
Browse files Browse the repository at this point in the history
…uded-versions-formbyformid-api-response

[Feature]: Included form major, minor versions to form by formid api response
  • Loading branch information
arun-s-aot authored Oct 14, 2024
2 parents 28e7be2 + 35b500a commit 47e4ff2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ def get_mapper_by_formid(form_id: str, **kwargs):
raise PermissionError("Tenant authentication failed.")
mapper_schema = FormProcessMapperSchema()
response = mapper_schema.dump(mapper)
# Include form versions
version_data = FormHistory.get_latest_version(mapper.parent_form_id)
major_version, minor_version = 1, 0
if version_data:
major_version = version_data.major_version
minor_version = version_data.minor_version
response["majorVersion"] = major_version
response["minorVersion"] = minor_version
if response.get("deleted") is False:
return response

Expand Down

0 comments on commit 47e4ff2

Please sign in to comment.