feat: implement micro-learning system with content delivery components, completion tracking hooks, and database schema migrations

This commit is contained in:
RaymondVerhoef
2026-05-24 23:40:59 +02:00
parent 8930ac03ae
commit 55bcb689e7
11 changed files with 700 additions and 166 deletions

View File

@@ -0,0 +1,17 @@
import pb from '../lib/pb';
export function useMicroLearnings() {
const getMicroLearningsByTopic = async (topicId) => {
try {
const records = await pb.collection('micro_learnings').getFullList({
filter: `topic_id = "${topicId}" && status = 'published'`,
});
return records;
} catch (err) {
console.error("Error fetching micro learnings:", err);
return [];
}
};
return { getMicroLearningsByTopic };
}