feat: lesson note version history (#374)
* chore: install diff package * chore: add id to render component * feat: implement language lesson version history * chore: fix darkmode colors and use tailwind css * chore: add screensize conditional * refactor: list updating after data fetch * change mode to view to prevent duplicate data being saved * chore: remove raw text * chore: db migration * feat: properly format timestamp * feat: add snackbar for success * chore: group by minutes, use icons instead of texts for buttons * docs: generate translations * refactor --------- Co-authored-by: Iniubong Obonguko <iniubongobonguko2018@gmail.com>
This commit is contained in:
co-authored by
Iniubong Obonguko
parent
decea8d1e5
commit
931ccb1a09
@@ -185,6 +185,16 @@ export function fetchLesson(lessonId: Lesson['id']) {
|
||||
.single();
|
||||
}
|
||||
|
||||
export function fetchLesssonLanguageHistory(lessonId: string, locale: string, endRange: number) {
|
||||
return supabase
|
||||
.from('lesson_versions')
|
||||
.select('*')
|
||||
.range(0, endRange)
|
||||
.eq('lesson_id', lessonId)
|
||||
.eq('locale', locale)
|
||||
.order('timestamp', { ascending: false });
|
||||
}
|
||||
|
||||
export function createLesson(lesson: any) {
|
||||
return supabase.from('lesson').insert(lesson).select();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user