fixing media URL
This commit is contained in:
parent
d544bc3359
commit
cc0b7b3e6f
|
|
@ -4,7 +4,7 @@ import logo from '../../../assets/images/logo-w.png';
|
|||
import logoutIllustration from '../../../assets/images/illustration/logout.png';
|
||||
import { Link } from 'react-router-dom';
|
||||
import useAuth from '../../../roles/guest/auth/hooks/useAuth';
|
||||
import { API_URL } from '../../../utils/Constant';
|
||||
import { MEDIA_URL } from '../../../utils/Constant';
|
||||
import avatar from '../../../assets/images/default-avatar.jpg';
|
||||
|
||||
function validName(fullName) {
|
||||
|
|
@ -54,7 +54,7 @@ const AdminNavbar = () => {
|
|||
<Dropdown as={ButtonGroup} align='end' className='ms-auto me-4 rounded rounded-35'>
|
||||
<Button variant="white" className='d-flex'>
|
||||
{/* <i className="me-2 bi bi-person-circle"></i> */}
|
||||
<img src={picture ? `${API_URL}/uploads/avatar/${picture}` : avatar} alt="profile"
|
||||
<img src={picture ? `${MEDIA_URL}/avatar/${picture}` : avatar} alt="profile"
|
||||
style={{
|
||||
objectFit:"cover",
|
||||
height:"24px",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|||
import { Nav, Button } from 'react-bootstrap';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import avatar from '../../../assets/images/default-avatar.jpg';
|
||||
import { API_URL } from '../../../utils/Constant';
|
||||
import { MEDIA_URL } from '../../../utils/Constant';
|
||||
|
||||
function validName(fullName) {
|
||||
const nameArray = fullName.split(" ");
|
||||
|
|
@ -26,7 +26,7 @@ const TeacherSideNav = () => {
|
|||
</Button>
|
||||
<div className="position-sticky pt-4">
|
||||
<div className="d-flex flex-column items-center mb-3 border-bottom">
|
||||
<img src={picture ? `${API_URL}/uploads/avatar/${picture}` : avatar} alt=""
|
||||
<img src={picture ? `${MEDIA_URL}/avatar/${picture}` : avatar} alt=""
|
||||
className="img-avatar"
|
||||
height={72} width={72}
|
||||
style={{objectFit:'cover'}}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|||
import { Nav, Button } from 'react-bootstrap';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import avatar from '../../../assets/images/default-avatar.jpg';
|
||||
import { API_URL } from '../../../utils/Constant';
|
||||
import { MEDIA_URL } from '../../../utils/Constant';
|
||||
|
||||
function validName(fullName) {
|
||||
const nameArray = fullName.split(" ");
|
||||
|
|
@ -26,7 +26,7 @@ const UserSideNav = () => {
|
|||
</Button>
|
||||
<div className="position-sticky pt-4">
|
||||
<div className="d-flex flex-column items-center mb-3 border-bottom">
|
||||
<img src={picture ? `${API_URL}/uploads/avatar/${picture}` : avatar} alt=""
|
||||
<img src={picture ? `${MEDIA_URL}/avatar/${picture}` : avatar} alt=""
|
||||
className="img-avatar"
|
||||
height={72} width={72}
|
||||
style={{objectFit:'cover'}}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const useUpdateExercises = (levelId) => {
|
|||
const [topicName, setTopicName] = useState('topic');
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const mediaPath = `${MEDIA_URL}/uploads/exercise`;
|
||||
const mediaPath = `${MEDIA_URL}/exercise`;
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
ID_ADMIN_EXERCISE: "",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const useTest = (materialId) => {
|
|||
const editorContainerRef = useRef(null);
|
||||
const editorRef = useRef(null);
|
||||
const [isLayoutReady, setIsLayoutReady] = useState(false);
|
||||
const mediaPath = `${MEDIA_URL}/uploads/level/`;
|
||||
const mediaPath = `${MEDIA_URL}/level/`;
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const useUpdateMaterials = (materialId) => {
|
|||
const [topicName, setTopicName] = useState('topic');
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const mediaPath = `${MEDIA_URL}/uploads/level`;
|
||||
const mediaPath = `${MEDIA_URL}/level`;
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
content: '',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import sectionService from '../services/serviceSections';
|
|||
import { MEDIA_URL } from '../../../../utils/Constant';
|
||||
|
||||
const useSections = () => {
|
||||
const thumbPath = `${MEDIA_URL}/uploads/section/`;
|
||||
const thumbPath = `${MEDIA_URL}/section/`;
|
||||
const [sections, setSections] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const useSettings = () => {
|
|||
const [loadingUpdate, setLoadingUpdate] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
const [success, setSuccess] = useState(false);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/avatar/`;
|
||||
const thumbPath = `${MEDIA_URL}/avatar/`;
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const useSettings = () => {
|
|||
const [loadingUpdate, setLoadingUpdate] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
const [success, setSuccess] = useState(false);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/avatar/`;
|
||||
const thumbPath = `${MEDIA_URL}/avatar/`;
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const useDashboards = () => {
|
|||
const [journey, setJourney] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/section/`;
|
||||
const thumbPath = `${MEDIA_URL}/section/`;
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { MEDIA_URL } from '../../../../../utils/Constant';
|
||||
|
||||
const ExerciseMedia = ({ image, audio, video }) => {
|
||||
const mediaPath = `${MEDIA_URL}/uploads/exercise`;
|
||||
const mediaPath = `${MEDIA_URL}/exercise`;
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ const MatchingPairsQuestion = ({ question, onAnswer, studentAnswer, index }) =>
|
|||
};
|
||||
|
||||
const mediaUrls = [];
|
||||
const mediaPath = `${MEDIA_URL}/uploads/exercise`;
|
||||
const mediaPath = `${MEDIA_URL}/exercise`;
|
||||
|
||||
if (question.IMAGE) mediaUrls.push(`${mediaPath}/image/${question.IMAGE}`);
|
||||
if (question.AUDIO) mediaUrls.push(`${mediaPath}/audio/${question.AUDIO}`);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const MultipleChoiceQuestion = ({ question, onAnswer, studentAnswer, index }) =>
|
|||
const options = question.multipleChoices[0];
|
||||
|
||||
const mediaUrls = [];
|
||||
const mediaPath = `${MEDIA_URL}/uploads/exercise`;
|
||||
const mediaPath = `${MEDIA_URL}/exercise`;
|
||||
|
||||
if (question.IMAGE) mediaUrls.push(`${mediaPath}/image/${question.IMAGE}`);
|
||||
if (question.AUDIO) mediaUrls.push(`${mediaPath}/audio/${question.AUDIO}`);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { MEDIA_URL } from '../../../../../utils/Constant';
|
|||
const TrueFalseQuestion = ({ question, onAnswer, studentAnswer, index }) => {
|
||||
const savedAnswer = studentAnswer !== null ? studentAnswer.ANSWER_STUDENT : null;
|
||||
const mediaUrls = [];
|
||||
const mediaPath = `${MEDIA_URL}/uploads/exercise`;
|
||||
const mediaPath = `${MEDIA_URL}/exercise`;
|
||||
|
||||
if (question.IMAGE) mediaUrls.push(`${mediaPath}/image/${question.IMAGE}`);
|
||||
if (question.AUDIO) mediaUrls.push(`${mediaPath}/audio/${question.AUDIO}`);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const useSections = () => {
|
|||
const [sections, setSections] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/section/`;
|
||||
const thumbPath = `${MEDIA_URL}/section/`;
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import useMaterial from '../hooks/useMaterials';
|
|||
|
||||
import MediaViewer from './components/MediaViewer';
|
||||
|
||||
import { API_URL } from '../../../../utils/Constant';
|
||||
import { MEDIA_URL } from '../../../../utils/Constant';
|
||||
|
||||
import { unSlugify } from '../../../../utils/Constant';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
|
|
@ -19,7 +19,7 @@ const Material = () => {
|
|||
const [localLoader, setLoader]= useState(true);
|
||||
|
||||
const [mediaUrls, setMedia] = useState([]);
|
||||
const mediaPath = `${API_URL}/uploads/level`;
|
||||
const mediaPath = `${MEDIA_URL}/level`;
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const useSettings = () => {
|
|||
const [loadingUpdate, setLoadingUpdate] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
const [success, setSuccess] = useState(false);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/avatar/`;
|
||||
const thumbPath = `${MEDIA_URL}/avatar/`;
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const useTopics = (sectionId) => {
|
|||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const [sections, setSection] = useState(null);
|
||||
const thumbPath = `${MEDIA_URL}/uploads/section/`;
|
||||
const thumbPath = `${MEDIA_URL}/section/`;
|
||||
const { sectionSlugMap } = useSlugContext();
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
export const API_URL = 'http://54.173.167.62/api';
|
||||
export const MEDIA_URL = 'http://54.173.167.62/media';
|
||||
export const MEDIA_URL = 'http://54.173.167.62/public';
|
||||
|
||||
export const slugify = (text) => {
|
||||
if (!text) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user