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';
export
const
getAllCurriculums
=
async
(
req
,
res
)
=>
{
try
{
const
curriculums
=
await
Curriculum
.
find
();
const
curriculums
=
await
Curriculum
.
find
()
.
populate
(
"
tutorials
"
)
;
res
.
status
(
200
).
json
(
curriculums
);
}
catch
(
error
)
{
res
.
status
(
500
).
json
({
message
:
error
.
message
});
}
}
}
;
export
const
getCurriculumById
=
async
(
req
,
res
)
=>
{
const
{
id
}
=
req
.
params
;
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
);
}
catch
(
error
)
{
res
.
status
(
404
).
json
({
message
:
'
Curriculum not found
'
});
res
.
status
(
500
).
json
({
message
:
error
.
message
});
}
}
}
;
export
const
createCurriculum
=
async
(
req
,
res
)
=>
{
const
curriculumData
=
req
.
body
;
...
...
Project/Backend/Server_Node/models/curriculum.model.js
View file @
12e80745
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
({
tutorialCode
:
String
,
tutorialTitle
:
String
,
tutorialDescription
:
String
,
tutorialImage
:
String
,
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
// Additional fields for tutorial content
});
const
curriculumSchema
=
new
mongoose
.
Schema
({
curriculumCode
:
String
,
curriculumLevel
:
String
,
curriculumName
:
String
,
curriculumTitle
:
String
,
curriculumDescription
:
String
,
curriculumImage
:
String
,
tutorials
:
[
tutorialSchema
],
// Embed tutorials as subdocuments
tutorials
:
[{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
"
Tutorial
"
,
}],
// Additional fields for curriculum details
status
:
{
type
:
Number
,
default
:
1
,
// Default status as active (1)
},
createdBy
:
String
,
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
...
commonFields
});
const
Curriculum
=
mongoose
.
model
(
"
Curriculum
"
,
curriculumSchema
);
...
...
Project/Backend/Server_Node/models/tutorial.model.js
View file @
12e80745
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
,
...
...
@@ -10,8 +23,12 @@ const taskItemSchema = new mongoose.Schema({
});
const
tutorialSchema
=
new
mongoose
.
Schema
({
tutorialCode
:
String
,
tutorialCode
:
{
type
:
String
,
unique
:
true
,
// Ensures unique values for tutorialCode
},
tutorialTitle
:
String
,
tutorialDescription
:
String
,
tutorialImage
:
String
,
taskItems
:
[
taskItemSchema
],
// Embed task items as subdocuments
// Additional fields for tutorial details
...
...
@@ -19,16 +36,7 @@ const tutorialSchema = new mongoose.Schema({
type
:
Number
,
default
:
1
,
// Default status as active (1)
},
createdBy
:
String
,
updatedBy
:
String
,
createdAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
updatedAt
:
{
type
:
Date
,
default
:
new
Date
(),
},
...
commonFields
});
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 = () => {
},
{
Header
:
'
Curriculum Name
'
,
accessor
:
'
curriculum
Nam
e
'
accessor
:
'
curriculum
Titl
e
'
},
{
Header
:
'
Status
'
,
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/curriculum-management/list/types/types.tsx
View file @
12e80745
...
...
@@ -24,7 +24,8 @@ export interface curriculumProps {
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumName
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
status
:
Number
;
...
...
@@ -38,6 +39,7 @@ export interface tutorialItemProps {
_id
:
number
|
string
|
undefined
;
tutorialCode
:
String
;
tutorialTitle
:
String
;
tutorialDescription
:
String
;
tutorialImage
:
String
;
status
:
Number
;
createdBy
:
String
;
...
...
Project/Frontend/SignConnectPlus/src/pages/parameter/tutorial-management/list/list.tsx
View file @
12e80745
...
...
@@ -152,7 +152,7 @@ const List = () => {
accessor
:
'
tutorialCode
'
},
{
Header
:
'
Tutorial
Titl
e
'
,
Header
:
'
Tutorial
Nam
e
'
,
accessor
:
'
tutorialTitle
'
},
{
...
...
Project/Frontend/SignConnectPlus/src/sections/parameters/curriculum-management/AddEditCurriculum.tsx
View file @
12e80745
...
...
@@ -51,7 +51,8 @@ export interface Props {
_id
:
number
|
string
|
undefined
;
curriculumCode
:
String
;
curriculumLevel
:
String
;
curriculumName
:
String
;
curriculumTitle
:
String
;
curriculumDescription
:
String
;
curriculumImage
:
String
;
tutorials
:
tutorialItemProps
[];
status
:
Number
;
...
...
@@ -67,6 +68,7 @@ export interface tutorialItemProps {
_id
:
number
|
string
|
undefined
;
tutorialCode
:
String
;
tutorialTitle
:
String
;
tutorialDescription
:
String
;
tutorialImage
:
String
;
status
:
Number
;
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