Commit 93fc9979 authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

Desc : update project
parent a6b843b5
import { tutorialType } from "types/tutorial"; import { Tutorial, tutorialType } from "types/tutorial";
export const tutorials: tutorialType[] = [ export const tutorials: tutorialType[] = [
{ {
...@@ -180,4 +180,23 @@ export const tutorials: tutorialType[] = [ ...@@ -180,4 +180,23 @@ export const tutorials: tutorialType[] = [
"createdAt": new Date("2023-08-30T12:00:00Z"), "createdAt": new Date("2023-08-30T12:00:00Z"),
"tutorialMark": 0, "tutorialMark": 0,
} }
] ]
\ No newline at end of file
export const tutorialReqOb: Tutorial = {
"tutorialCode": "Tutorial Code -12312",
"tutorialTitle": "Tutorial Title",
"tutorialImage": "Tutorial Image",
"tutorialDescription": "Tutorial Description",
"taskItems": [
{
"title": "Task Title -213123",
"description": "Task Reference Image",
//@ts-ignore
"howToDo": "Task How To Do",
"referenceImage": "Task Reference Image",
"referenceVideo": "Task Reference Image",
"taskItemMark": 10
}
],
"createdBy": "Nuwan Gamage"
}
\ No newline at end of file
...@@ -40,8 +40,8 @@ import AlertTutorialDelete from 'sections/parameters/tutorial-management/AlertTu ...@@ -40,8 +40,8 @@ import AlertTutorialDelete from 'sections/parameters/tutorial-management/AlertTu
import { useDispatch, useSelector } from 'store'; import { useDispatch, useSelector } from 'store';
import { openSnackbar } from 'store/reducers/snackbar'; import { openSnackbar } from 'store/reducers/snackbar';
import { fetchTutorials, toInitialState } from 'store/reducers/tutorial'; import { fetchTutorials, toInitialState } from 'store/reducers/tutorial';
import { Tutorials } from 'types/tutorial'; import { Tutorial, Tutorials } from 'types/tutorial';
import { ReactTableProps, tutorialProps } from './types/types'; import { ReactTableProps } from './types/types';
// ==============================|| REACT TABLE ||============================== // // ==============================|| REACT TABLE ||============================== //
...@@ -396,7 +396,7 @@ const List = () => { ...@@ -396,7 +396,7 @@ const List = () => {
//dialog model //dialog model
const [addEdit, setAddEdit] = useState<boolean>(false); const [addEdit, setAddEdit] = useState<boolean>(false);
const [tutorial, setTutorial] = useState<tutorialProps>(); const [tutorial, setTutorial] = useState<Tutorial>();
const handleAddEdit = () => { const handleAddEdit = () => {
setAddEdit(!addEdit); setAddEdit(!addEdit);
...@@ -481,7 +481,7 @@ const List = () => { ...@@ -481,7 +481,7 @@ const List = () => {
sx={{ '& .MuiDialog-paper': { p: 0 }, transition: 'transform 225ms' }} sx={{ '& .MuiDialog-paper': { p: 0 }, transition: 'transform 225ms' }}
aria-describedby="alert-dialog-slide-description" aria-describedby="alert-dialog-slide-description"
> >
<AddEditTutorial tutorial={tutorial} onCancel={handleAddEdit} /> <AddEditTutorial tutorial={tutorial!} onCancel={handleAddEdit} />
</Dialog> </Dialog>
{/* alert model */} {/* alert model */}
{!tutorial && <AlertTutorialDelete title={""} open={openAlert} handleClose={handleAlertClose} deleteId={tutorialId} />} {!tutorial && <AlertTutorialDelete title={""} open={openAlert} handleClose={handleAlertClose} deleteId={tutorialId} />}
......
...@@ -21,11 +21,11 @@ export type Tutorial = { ...@@ -21,11 +21,11 @@ export type Tutorial = {
tutorialTitle?: string tutorialTitle?: string
tutorialDescription?: string tutorialDescription?: string
tutorialImage?: string tutorialImage?: string
tutorialMark: number tutorialMark?: number
taskItems: taskItemType[] taskItems: taskItemType[]
status: number status?: number
createdBy: string createdBy: string
createdAt: Date createdAt?: Date
updatedBy?: string updatedBy?: string
updatedAt?: Date updatedAt?: Date
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment