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
768aeabf
Commit
768aeabf
authored
Nov 16, 2022
by
Jayasith H.B.C
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue
parent
52064e0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
backend/database.db
backend/database.db
+0
-0
frontend/src/pages/StudentDashboard.js
frontend/src/pages/StudentDashboard.js
+8
-3
frontend/src/pages/SubjectsStudent.js
frontend/src/pages/SubjectsStudent.js
+3
-5
No files found.
backend/database.db
0 → 100644
View file @
768aeabf
File added
frontend/src/pages/StudentDashboard.js
View file @
768aeabf
...
...
@@ -40,14 +40,14 @@ const StudentDashboard = () => {
const
renderOrderBody
=
(
item
,
index
)
=>
(
<
tr
key
=
{
index
}
>
<
td
>
{
index
+
1
}
<
/td
>
<
td
>
{}
<
/td
>
<
td
>
{
item
.
id
}
<
/td
>
<
td
>
{
item
.
code
}
<
/td
>
<
td
>
{
item
.
name
}
<
/td
>
<
td
>
{
item
.
assignment_type
}
<
/td
>
<
td
>
{
item
.
title
}
<
/td
>
<
td
>
{
new
Date
(
item
.
start_at
).
toLocaleString
()}
<
/td
>
<
td
>
{
new
Date
(
item
.
en
d_at
).
toLocaleString
()}
<
/td
>
<
td
>
{
new
Date
(
item
.
update
d_at
).
toLocaleString
()}
<
/td
>
<
/tr
>
);
...
...
@@ -56,10 +56,14 @@ const StudentDashboard = () => {
const
res
=
await
axios
.
get
(
`assignments`
);
setStudentSubjects
(
res
.
data
.
assignments
);
setIsLoading
(
false
);
}
catch
(
err
)
{
console
.
log
(
err
.
response
);
}
};
console
.
log
(
StudentSubjects
);
useEffect
(()
=>
getAllSubjects
(),
[]);
return
(
...
...
@@ -130,13 +134,14 @@ const StudentDashboard = () => {
{
/* {isLoading ? (
<Spinner />
) : orderDetails.length > 0 ? ( */
}
{
StudentSubjects
.
length
!==
0
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
StudentSubjects
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
/>
:''
}
{
/* ) : (
<>
{setError("No Assignments found")}
...
...
frontend/src/pages/SubjectsStudent.js
View file @
768aeabf
...
...
@@ -16,15 +16,12 @@ const SubjectsStudent = () => {
const
[
isLoading
,
setIsLoading
]
=
useState
(
true
);
const
[
StudentSubjects
,
setStudentSubjects
]
=
useState
([]);
const
fields
=
[
""
,
"
ID
"
,
"
Module Code
"
,
"
Module Name
"
,
"
Assignment Type
"
,
"
Title
"
,
"
Start At
"
,
"
End At
"
,
"
Actions
"
,
""
,
];
const
renderOrderHead
=
(
item
,
index
)
=>
<
th
key
=
{
index
}
>
{
item
}
<
/th>
;
...
...
@@ -68,13 +65,14 @@ const SubjectsStudent = () => {
{
/* {isLoading ? (
<Spinner />
) : orderDetails.length > 0 ? ( */
}
{
StudentSubjects
.
length
!==
0
?
<
Table
limit
=
"
5
"
headData
=
{
fields
}
renderHead
=
{(
item
,
index
)
=>
renderOrderHead
(
item
,
index
)}
bodyData
=
{
StudentSubjects
}
renderBody
=
{(
item
,
index
)
=>
renderOrderBody
(
item
,
index
)}
/
>
/>
:''
}
{
/* ) : (
<>
{setError("No Assignments found")}
...
...
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