diff --git a/src/screens/AuthScreen/Util.ts b/src/screens/AuthScreen/Util.ts index cbd70294..9947382e 100644 --- a/src/screens/AuthScreen/Util.ts +++ b/src/screens/AuthScreen/Util.ts @@ -155,6 +155,6 @@ export const formatTimeToUnix = (date) => { const newDate = new Date(date); // Convert the date to Unix Epoch timestamp in seconds - const unixTimestampInSeconds = newDate.getTime() / 1000; + const unixTimestampInSeconds = newDate.getTime(); return unixTimestampInSeconds; }; diff --git a/src/screens/HomeScreen/HomeScreenV2.tsx b/src/screens/HomeScreen/HomeScreenV2.tsx index 97b080c3..5eabac30 100644 --- a/src/screens/HomeScreen/HomeScreenV2.tsx +++ b/src/screens/HomeScreen/HomeScreenV2.tsx @@ -36,7 +36,9 @@ const HomeScreenV2 = (): JSX.Element => { const handleButtonPress = async () => { if (status === 'OOO') { + setIsLoading(true); await cancelOoo(loggedInUserData?.token); + setIsLoading(false); } else { setIsFormVisible((prev) => !prev); } @@ -50,10 +52,11 @@ const HomeScreenV2 = (): JSX.Element => { message: description, state: 'OOO', until: formatTimeToUnix(toDate), - updateAt: formatTimeToUnix(Date.now), + updatedAt: formatTimeToUnix(currentDate), }, }; - await submitOOOForm(data, loggedInUserData?.token); + const res = await submitOOOForm(data, loggedInUserData?.token); + console.log(res); setIsLoading(false); // Clear loading state after API call setIsFormVisible(false); // Hide the form after a successful submission }; diff --git a/src/screens/ProfileScreen/ProfileScreen.tsx b/src/screens/ProfileScreen/ProfileScreen.tsx index b35a7a1a..bd26f9f0 100644 --- a/src/screens/ProfileScreen/ProfileScreen.tsx +++ b/src/screens/ProfileScreen/ProfileScreen.tsx @@ -19,11 +19,11 @@ import UploadImageModalView from '../../components/GalleryModal'; import { AuthContext } from '../../context/AuthContext'; import { ImagePickerResponse } from 'react-native-image-picker'; import Strings from '../../i18n/en'; -import AllContributionsDropdown from './User Data/UserContributions/AllContributions'; import NoteworthyContributionsDropdown from './User Data/UserContributions/NoteWorthyContributions'; import ActiveTaskDropDown from './User Data/UserContributions/ActiveTask'; import UserData from './User Data/UserData'; import { useSelector, useDispatch } from 'react-redux'; +import AllContributionsDropdown from './User Data/UserContributions/AllContributions'; const ProfileScreen = () => { const dispatch = useDispatch();