phase 1-6 implemented
This commit is contained in:
1 parent
22c274bb83
commit
2c4927478a
73 files changed
+9702
-2354
No files matched your search
@@ -12,6 +12,7 @@ import {
|
||||
import { useUser, useAuth } from "@clerk/clerk-expo";
|
||||
import { useRouter } from "expo-router";
|
||||
import { fitnessProfileApi } from "@/api/fitnessProfile";
|
||||
import log from "../../utils/logger";
|
||||
|
||||
export default function OnboardingScreen() {
|
||||
const { user } = useUser();
|
||||
@@ -37,7 +38,7 @@ export default function OnboardingScreen() {
|
||||
setGyms(data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to fetch gyms:", e);
|
||||
log.error("Failed to fetch gyms", e);
|
||||
} finally {
|
||||
setGymsLoading(false);
|
||||
}
|
||||
@@ -84,7 +85,7 @@ export default function OnboardingScreen() {
|
||||
body: JSON.stringify({ gymId: selectedGymId }),
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn("Failed to update gym selection:", e);
|
||||
log.warn("Failed to update gym selection", { gymId: selectedGymId });
|
||||
}
|
||||
|
||||
const fitnessData = {
|
||||
@@ -108,7 +109,7 @@ export default function OnboardingScreen() {
|
||||
await fitnessProfileApi.createFitnessProfile(fitnessData, token);
|
||||
router.replace("/(tabs)");
|
||||
} catch (error) {
|
||||
console.error("Error creating fitness profile:", error);
|
||||
log.error("Failed to create fitness profile", error);
|
||||
Alert.alert(
|
||||
"Error",
|
||||
"Failed to create fitness profile. Please try again.",
|
||||
|
||||
Reference in new issue
Block a user