feat: add organization exercise settings management

- Created a new SQL migration to define the organization_exercise_settings table with relevant fields and an index.
- Implemented handlers for loading and updating organization exercise settings in Rust, including default values and upsert functionality.
- Developed a React component for managing exercise feature settings, allowing toggling of features and saving updates to the backend.
This commit is contained in:
2026-04-13 16:55:09 -04:00
parent 7f3e1ce9b1
commit c750ad0423
17 changed files with 899 additions and 44 deletions
@@ -2,7 +2,7 @@
import { useState, useEffect } from "react";
import { Play, Lock, AlertCircle } from "lucide-react";
import { lmsApi, getCmsApiUrl } from "@/lib/api";
import { lmsApi, getCmsApiUrl, getImageUrl } from "@/lib/api";
interface MediaPlayerProps {
id: string;
@@ -49,7 +49,9 @@ export default function MediaPlayer({ id, lessonId, title, url, media_type, conf
const getFullUrl = (path: string) => {
if (path.startsWith('http')) return path;
if (path.startsWith('http') || path.startsWith('s3://') || path.startsWith('org/')) {
return getImageUrl(path);
}
// Map /uploads to /assets for the backend
const cleanPath = path.startsWith('/uploads') ? path.replace('/uploads', '/assets') : path;
const finalPath = cleanPath.startsWith('/') ? cleanPath : `/${cleanPath}`;