@@ -65,21 +65,21 @@ const LocationApprove: FC<IProps> = ({ isOpen, onClose, news, newFlashTitle }) =
6565 const userInfo = userStore . userInfo && userStore . userInfo . data && userStore . userInfo . data . firstName ?
6666 userStore . userInfo . data . firstName . concat ( userStore . userInfo . data . lastName ) : null ;
6767
68- function handleApproveButton ( ) {
69- if ( shouldApprove && locationChanged ) {
70- if ( newStreetLoc ) {
71- updateNews ( news . id , locationQualificationOptions . MANUAL , newStreetLoc , null ) ;
72- } else {
73- updateNews ( news . id , locationQualificationOptions . MANUAL , null , newGpsLoc ) ;
74- }
75- } else if ( shouldApprove ) {
76- updateNews ( news . id , locationQualificationOptions . VERIFIED , null , null ) ;
68+ async function handleApproveButton ( ) {
69+ if ( shouldApprove && locationChanged ) {
70+ if ( newStreetLoc ) {
71+ await updateNews ( news . id , locationQualificationOptions . MANUAL , newStreetLoc , null ) ;
7772 } else {
78- updateNews ( news . id , locationQualificationOptions . REJECTED , null , null ) ;
73+ await updateNews ( news . id , locationQualificationOptions . MANUAL , null , newGpsLoc ) ;
7974 }
80- onCloseInitValues ( ) ;
81- window . location . reload ( ) ;
75+ } else if ( shouldApprove ) {
76+ await updateNews ( news . id , locationQualificationOptions . VERIFIED , null , null ) ;
77+ } else {
78+ await updateNews ( news . id , locationQualificationOptions . REJECTED , null , null ) ;
8279 }
80+ onCloseInitValues ( ) ;
81+ window . location . reload ( ) ;
82+ }
8383
8484 const handleCloseButton = ( ) => onCloseInitValues ( ) ;
8585
0 commit comments