|
@@ -180,6 +180,8 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
if (deleteLandmarkMutation.isSuccess) {
|
|
if (deleteLandmarkMutation.isSuccess) {
|
|
deleteLandmarkMutation.reset()
|
|
deleteLandmarkMutation.reset()
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ console.log(deleteLandmarkMutation.status)
|
|
}
|
|
}
|
|
resetDeleteLMOnSuccess();
|
|
resetDeleteLMOnSuccess();
|
|
}, [deleteLandmarkMutation.status]);
|
|
}, [deleteLandmarkMutation.status]);
|
|
@@ -236,14 +238,14 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
* Calls the {@linkcode deleteLandmark} mutation from the {@link useLandmarks} hook and closes the modal once finished.
|
|
* Calls the {@linkcode deleteLandmark} mutation from the {@link useLandmarks} hook and closes the modal once finished.
|
|
*/
|
|
*/
|
|
const removeLandmark = async () => {
|
|
const removeLandmark = async () => {
|
|
- Alert.alert("Are you sure you want to delete landmark here?", undefined,
|
|
|
|
|
|
+ Alert.alert("Are you sure you want to delete this landmark?", undefined,
|
|
[{ text: "Cancel", }
|
|
[{ text: "Cancel", }
|
|
,
|
|
,
|
|
{
|
|
{
|
|
text: "Confirm", onPress: async () => {
|
|
text: "Confirm", onPress: async () => {
|
|
await deleteLandmarkMutation.mutateAsync(landmarkId);
|
|
await deleteLandmarkMutation.mutateAsync(landmarkId);
|
|
toggleDetailsPanel(false);
|
|
toggleDetailsPanel(false);
|
|
- Alert.alert("LANDMARK HAS BEEN DELETED")
|
|
|
|
|
|
+ Alert.alert("Landmark Deleted", "This landmark has been deleted.");
|
|
}
|
|
}
|
|
}])
|
|
}])
|
|
}
|
|
}
|
|
@@ -370,8 +372,8 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
|
|
</View>
|
|
</View>
|
|
:
|
|
:
|
|
(landmarkQuery.isSuccess || landmarkQuery.isIdle) &&
|
|
(landmarkQuery.isSuccess || landmarkQuery.isIdle) &&
|
|
- editLandmarkMutation.isIdle || editLandmarkMutation.isSuccess &&
|
|
|
|
- deleteLandmarkMutation.isIdle || deleteLandmarkMutation.isSuccess ?
|
|
|
|
|
|
+ (editLandmarkMutation.isIdle || editLandmarkMutation.isSuccess) &&
|
|
|
|
+ (deleteLandmarkMutation.isIdle || deleteLandmarkMutation.isSuccess) ?
|
|
<>
|
|
<>
|
|
<DetailsHeader
|
|
<DetailsHeader
|
|
authNavigation={authNavigation}
|
|
authNavigation={authNavigation}
|