Skip to content

Commit

Permalink
Ensure that user override prompts to not prevent save redirects on di…
Browse files Browse the repository at this point in the history
…sposition add screen.
  • Loading branch information
devinleighsmith committed Dec 17, 2024
1 parent f4b1444 commit f1ef8b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/backend/api/Services/PropertyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public PimsProperty Update(PimsProperty property, bool commitTransaction = true)

// convert spatial location from lat/long (4326) to BC Albers (3005) for database storage
var geom = property.Location;
if (geom != null && geom.SRID != SpatialReference.BCALBERS)
if (geom is not null && geom.SRID != SpatialReference.BCALBERS)
{
var newCoords = _coordinateService.TransformCoordinates(geom.SRID, SpatialReference.BCALBERS, geom.Coordinate);
property.Location = GeometryHelper.CreatePoint(newCoords, SpatialReference.BCALBERS);
Expand Down Expand Up @@ -371,7 +371,7 @@ public PimsProperty PopulateNewProperty(PimsProperty property, bool isOwned = fa

// convert spatial location from lat/long (4326) to BC Albers (3005) for database storage
var geom = property.Location;
if (geom != null && geom.SRID != SpatialReference.BCALBERS)
if (geom is not null && geom.SRID != SpatialReference.BCALBERS)
{
var newCoords = _coordinateService.TransformCoordinates(geom.SRID, SpatialReference.BCALBERS, geom.Coordinate);
property.Location = GeometryHelper.CreatePoint(newCoords, SpatialReference.BCALBERS);
Expand All @@ -397,7 +397,7 @@ public void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty prope

// convert spatial location from lat/long (4326) to BC Albers (3005) for database storage
var geom = incomingProperty.Location;
if (geom != null && geom.SRID != SpatialReference.BCALBERS)
if (geom is not null && geom.SRID != SpatialReference.BCALBERS)
{
var newCoords = _coordinateService.TransformCoordinates(geom.SRID, SpatialReference.BCALBERS, geom.Coordinate);
propertyToUpdate.Location = GeometryHelper.CreatePoint(newCoords, SpatialReference.BCALBERS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const AddDispositionContainer: React.FC<IAddDispositionContainerProps> = ({
userOverrideCodes: UserOverrideCode[],
) => {
try {
formikHelpers.setSubmitting(true);
const dispositionFile = values.toApi();
const response = await addDispositionFileApi(dispositionFile, userOverrideCodes);

Expand All @@ -183,7 +184,7 @@ const AddDispositionContainer: React.FC<IAddDispositionContainerProps> = ({
onSubmit={(
values: DispositionFormModel,
formikHelpers: FormikHelpers<DispositionFormModel>,
) =>
) => {
withUserOverride(
(userOverrideCodes: UserOverrideCode[]) =>
handleSubmit(values, formikHelpers, userOverrideCodes),
Expand All @@ -197,8 +198,8 @@ const AddDispositionContainer: React.FC<IAddDispositionContainerProps> = ({
});
setDisplayModal(true);
},
)
}
);
}}
></View>
);
};
Expand Down

0 comments on commit f1ef8b4

Please sign in to comment.