Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIMS-526: Upload Properties failing when Location doesn't exist #1964

Closed
wants to merge 1 commit into from

Conversation

LawrenceLau2020
Copy link
Collaborator

🎯 Summary

PIMS-526:

Did some refactoring to check admin areas before sending to api, for some reason was getting a bunch of "Administrative area 'xxxxx' does not exist in the datasource".

This PR is a work in progress to see if we can simplify what needs to be fixed.

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

Copy link

github-actions bot commented Dec 6, 2023

🚀 Deployment Information

The APP Image has been built with the tag: 1964. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the APP deployment. For more updates please monitor Image Tags Page on Wiki.

@@ -104,6 +106,8 @@ export const UploadProperties: React.FC = () => {
setPhase(UploadPhase.FILE_SELECT);
};

// Fetch existingAdminAreas using useCodeLookups
const lookupCodes = useCodeLookups();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't seem to get this useCodeLookups() hook to work inside the csvToPropertyModel.ts

(property: IExportedPropertyModel) => {
const city = existingAdminAreas.some((adminArea) => adminArea.name === property.Location)
? property.Location || ''
: getValueOrDefault(property['Regional District'], '');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the value from the Location column of the spreadsheet if it exists in the administrative areas in PIMS, if not then use the value from the Regional District column.

@LawrenceLau2020
Copy link
Collaborator Author

There was no issue with the upload feature, was a container issue.

@TaylorFries TaylorFries deleted the PIMS-526 branch October 25, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant