Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-158
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
2
Merge Requests
2
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
2022-158
2022-158
Commits
16bfceb2
Commit
16bfceb2
authored
Oct 03, 2022
by
Thushara Thiwanka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CREATE : get modules integrated
parent
7dcae612
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
backend/database.db
backend/database.db
+0
-0
frontend/src/pages/ManageModules.js
frontend/src/pages/ManageModules.js
+6
-9
No files found.
backend/database.db
View file @
16bfceb2
No preview for this file type
frontend/src/pages/ManageModules.js
View file @
16bfceb2
...
...
@@ -20,11 +20,6 @@ const ManageModules = () => {
const
fields
=
[
""
,
"
Module Code
"
,
"
Module Name
"
,
"
Created At
"
,
"
Actions
"
];
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
const
classes
=
[
{
code
:
"
A001
"
,
name
:
"
CTSE
"
,
createdAt
:
"
2022-04-05
"
},
{
code
:
"
A002
"
,
name
:
"
CTSE
"
,
createdAt
:
"
2022-04-05
"
},
{
code
:
"
A003
"
,
name
:
"
CTSE
"
,
createdAt
:
"
2022-04-05
"
},
];
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
...
...
@@ -40,7 +35,7 @@ const ManageModules = () => {
className
=
"
action-btn x
"
style
=
{{
marginLeft
:
"
2rem
"
}}
onClick
=
{()
=>
{
if
(
window
.
confirm
(
"
Are you sure to delete this
class
?
"
))
{
if
(
window
.
confirm
(
"
Are you sure to delete this
module
?
"
))
{
deleteHandler
(
item
.
_id
,
item
.
username
);
}
}}
...
...
@@ -95,8 +90,10 @@ const ManageModules = () => {
};
const
getAllModules
=
async
()
=>
{
setIsLoading
(
true
);
try
{
const
res
=
await
axios
.
get
(
`modules`
);
const
res
=
await
axios
.
get
(
"
modules
"
);
console
.
log
(
res
);
setModules
(
res
.
data
.
modules
);
setIsLoading
(
false
);
}
catch
(
err
)
{
...
...
@@ -165,14 +162,14 @@ const ManageModules = () => {
<
/div
>
<
div
className
=
"
card col-12
"
>
<
h2
>
Created
Modules
<
/h2
>
{
false
?
(
{
isLoading
?
(
<
Spinner
/>
)
:
(
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
class
es
}
bodyData
=
{
modul
es
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
)}
...
...
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