Skip to content

Instantly share code, notes, and snippets.

View MohammadHarisZia's full-sized avatar
🎯
Focusing

Mohammad Haris Zia MohammadHarisZia

🎯
Focusing
View GitHub Profile
@MohammadHarisZia
MohammadHarisZia / gist:a3ddb60aea8fe8d990d90fcd0b95bcbd
Last active July 11, 2024 16:27
Exercise Progress and Total Progress
/* eslint-disable max-lines-per-function */
import { getUser } from '@/core/auth/utils';
import { getSupabaseMobileClient } from '../common';
type ExerciseLimit = {
lesson_type: string;
level: number;
num_exercises: number;
};
const fetchUserExerciseProgress = async () => {
const client = getSupabaseMobileClient();
const user = await getUser();
// Fetch user exercise levels
const { data: userLevelsData, error: userLevelsError } = await client
.from('user_exercise_levels')
.select('*')
.eq('user_id', user.id);