Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2023-029
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2023-029
2023-029
Commits
12e80745
Commit
12e80745
authored
Aug 30, 2023
by
janithgamage1.ed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : update
Desc : update project
parent
3feec0c2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
32 deletions
+66
-32
Project/Backend/Server_Node/controllers/curriculum.controller.js
.../Backend/Server_Node/controllers/curriculum.controller.js
+8
-5
Project/Backend/Server_Node/models/curriculum.model.js
Project/Backend/Server_Node/models/curriculum.model.js
+31
-12
Project/Backend/Server_Node/models/tutorial.model.js
Project/Backend/Server_Node/models/tutorial.model.js
+19
-11
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/list.tsx
...s/src/pages/parameter/curriculum-management/list/list.tsx
+1
-1
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
...ages/parameter/curriculum-management/list/types/types.tsx
+3
-1
Project/Frontend/SignConnectPlus/src/pages/parameter/tutorial-management/list/list.tsx
...lus/src/pages/parameter/tutorial-management/list/list.tsx
+1
-1
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
...ns/parameters/curriculum-management/AddEditCurriculum.tsx
+3
-1
No files found.
Project/Backend/Server_Node/controllers/curriculum.controller.js
View file @
12e80745
...
@@ -2,22 +2,25 @@ import Curriculum from '../models/curriculum.model.js';
...
@@ -2,22 +2,25 @@ import Curriculum from '../models/curriculum.model.js';
export
const
getAllCurriculums
=
async
(
req
,
res
)
=>
{
export
const
getAllCurriculums
=
async
(
req
,
res
)
=>
{
try
{
try
{
const
curriculums
=
await
Curriculum
.
find
();
const
curriculums
=
await
Curriculum
.
find
()
.
populate
(
"
tutorials
"
)
;
res
.
status
(
200
).
json
(
curriculums
);
res
.
status
(
200
).
json
(
curriculums
);
}
catch
(
error
)
{
}
catch
(
error
)
{
res
.
status
(
500
).
json
({
message
:
error
.
message
});
res
.
status
(
500
).
json
({
message
:
error
.
message
});
}
}
}
}
;
export
const
getCurriculumById
=
async
(
req
,
res
)
=>
{
export
const
getCurriculumById
=
async
(
req
,
res
)
=>
{
const
{
id
}
=
req
.
params
;
const
{
id
}
=
req
.
params
;
try
{
try
{
const
curriculum
=
await
Curriculum
.
findById
(
id
);
const
curriculum
=
await
Curriculum
.
findById
(
id
).
populate
(
"
tutorials
"
);
if
(
!
curriculum
)
{
return
res
.
status
(
404
).
json
({
message
:
'
Curriculum not found
'
});
}
res
.
status
(
200
).
json
(
curriculum
);
res
.
status
(
200
).
json
(
curriculum
);
}
catch
(
error
)
{
}
catch
(
error
)
{
res
.
status
(
404
).
json
({
message
:
'
Curriculum not found
'
});
res
.
status
(
500
).
json
({
message
:
error
.
message
});
}
}
}
}
;
export
const
createCurriculum
=
async
(
req
,
res
)
=>
{
export
const
createCurriculum
=
async
(
req
,
res
)
=>
{
const
curriculumData
=
req
.
body
;
const
curriculumData
=
req
.
body
;
...
...
Project/Backend/Server_Node/models/curriculum.model.js
View file @
12e80745
import
mongoose
from
"
mongoose
"
;
import
mongoose
from
"
mongoose
"
;
const
commonFields
=
{
createdBy
:
String
,
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
};
const
taskItemSchema
=
new
mongoose
.
Schema
({
title
:
String
,
description
:
String
,
howToDo
:
String
,
referenceImage
:
String
,
referenceVideo
:
String
,
// Additional fields for task items
});
const
tutorialSchema
=
new
mongoose
.
Schema
({
const
tutorialSchema
=
new
mongoose
.
Schema
({
tutorialCode
:
String
,
tutorialCode
:
String
,
tutorialTitle
:
String
,
tutorialTitle
:
String
,
tutorialDescription
:
String
,
tutorialImage
:
String
,
tutorialImage
:
String
,
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
// Additional fields for tutorial content
// Additional fields for tutorial content
});
});
const
curriculumSchema
=
new
mongoose
.
Schema
({
const
curriculumSchema
=
new
mongoose
.
Schema
({
curriculumCode
:
String
,
curriculumCode
:
String
,
curriculumLevel
:
String
,
curriculumLevel
:
String
,
curriculumName
:
String
,
curriculumTitle
:
String
,
curriculumDescription
:
String
,
curriculumImage
:
String
,
curriculumImage
:
String
,
tutorials
:
[
tutorialSchema
],
// Embed tutorials as subdocuments
tutorials
:
[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
"
Tutorial
"
,
}],
// Additional fields for curriculum details
// Additional fields for curriculum details
status
:
{
status
:
{
type
:
Number
,
type
:
Number
,
default
:
1
,
// Default status as active (1)
default
:
1
,
// Default status as active (1)
},
},
createdBy
:
String
,
...
commonFields
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
});
});
const
Curriculum
=
mongoose
.
model
(
"
Curriculum
"
,
curriculumSchema
);
const
Curriculum
=
mongoose
.
model
(
"
Curriculum
"
,
curriculumSchema
);
...
...
Project/Backend/Server_Node/models/tutorial.model.js
View file @
12e80745
import
mongoose
from
"
mongoose
"
;
import
mongoose
from
"
mongoose
"
;
const
commonFields
=
{
createdBy
:
String
,
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
};
const
taskItemSchema
=
new
mongoose
.
Schema
({
const
taskItemSchema
=
new
mongoose
.
Schema
({
title
:
String
,
title
:
String
,
description
:
String
,
description
:
String
,
...
@@ -10,8 +23,12 @@ const taskItemSchema = new mongoose.Schema({
...
@@ -10,8 +23,12 @@ const taskItemSchema = new mongoose.Schema({
});
});
const
tutorialSchema
=
new
mongoose
.
Schema
({
const
tutorialSchema
=
new
mongoose
.
Schema
({
tutorialCode
:
String
,
tutorialCode
:
{
type
:
String
,
unique
:
true
,
// Ensures unique values for tutorialCode
},
tutorialTitle
:
String
,
tutorialTitle
:
String
,
tutorialDescription
:
String
,
tutorialImage
:
String
,
tutorialImage
:
String
,
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
// Additional fields for tutorial details
// Additional fields for tutorial details
...
@@ -19,16 +36,7 @@ const tutorialSchema = new mongoose.Schema({
...
@@ -19,16 +36,7 @@ const tutorialSchema = new mongoose.Schema({
type
:
Number
,
type
:
Number
,
default
:
1
,
// Default status as active (1)
default
:
1
,
// Default status as active (1)
},
},
createdBy
:
String
,
...
commonFields
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
});
});
const
Tutorial
=
mongoose
.
model
(
"
Tutorial
"
,
tutorialSchema
);
const
Tutorial
=
mongoose
.
model
(
"
Tutorial
"
,
tutorialSchema
);
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/list.tsx
View file @
12e80745
...
@@ -157,7 +157,7 @@ const List = () => {
...
@@ -157,7 +157,7 @@ const List = () => {
},
},
{
{
Header
:
'
Curriculum Name
'
,
Header
:
'
Curriculum Name
'
,
accessor
:
'
curriculum
Nam
e
'
accessor
:
'
curriculum
Titl
e
'
},
},
{
{
Header
:
'
Status
'
,
Header
:
'
Status
'
,
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
View file @
12e80745
...
@@ -24,7 +24,8 @@ export interface curriculumProps {
...
@@ -24,7 +24,8 @@ export interface curriculumProps {
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
String
;
curriculumName
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
tutorials
:
tutorialItemProps
[];
status
:
Number
;
status
:
Number
;
...
@@ -38,6 +39,7 @@ export interface tutorialItemProps {
...
@@ -38,6 +39,7 @@ export interface tutorialItemProps {
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
tutorialCode
:
String
;
tutorialCode
:
String
;
tutorialTitle
:
String
;
tutorialTitle
:
String
;
tutorialDescription
:
String
;
tutorialImage
:
String
;
tutorialImage
:
String
;
status
:
Number
;
status
:
Number
;
createdBy
:
String
;
createdBy
:
String
;
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/tutorial-management/list/list.tsx
View file @
12e80745
...
@@ -152,7 +152,7 @@ const List = () => {
...
@@ -152,7 +152,7 @@ const List = () => {
accessor
:
'
tutorialCode
'
accessor
:
'
tutorialCode
'
},
},
{
{
Header
:
'
Tutorial
Titl
e
'
,
Header
:
'
Tutorial
Nam
e
'
,
accessor
:
'
tutorialTitle
'
accessor
:
'
tutorialTitle
'
},
},
{
{
...
...
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
View file @
12e80745
...
@@ -51,7 +51,8 @@ export interface Props {
...
@@ -51,7 +51,8 @@ export interface Props {
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumLevel
:
String
;
curriculumName
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
tutorials
:
tutorialItemProps
[];
status
:
Number
;
status
:
Number
;
...
@@ -67,6 +68,7 @@ export interface tutorialItemProps {
...
@@ -67,6 +68,7 @@ export interface tutorialItemProps {
_id
:
number
|
string
|
undefined
;
_id
:
number
|
string
|
undefined
;
tutorialCode
:
String
;
tutorialCode
:
String
;
tutorialTitle
:
String
;
tutorialTitle
:
String
;
tutorialDescription
:
String
;
tutorialImage
:
String
;
tutorialImage
:
String
;
status
:
Number
;
status
:
Number
;
createdBy
:
String
;
createdBy
:
String
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment