Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nisum-scorecard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkaiah Naidu Singamchetty
nisum-scorecard
Commits
d6513c10
Commit
d6513c10
authored
Mar 14, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Plain Diff
'server--comments-added'
parents
189ba31b
a6392805
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
server.js
server.js
+8
-5
No files found.
server.js
View file @
d6513c10
...
@@ -25,6 +25,7 @@ app.get('/employees', (req, res) => {
...
@@ -25,6 +25,7 @@ app.get('/employees', (req, res) => {
.
catch
(
error
=>
res
.
status
(
401
).
send
(
error
))
.
catch
(
error
=>
res
.
status
(
401
).
send
(
error
))
})
})
//to get only individual employee data
app
.
get
(
'/employee/:id'
,
(
req
,
res
)
=>
{
app
.
get
(
'/employee/:id'
,
(
req
,
res
)
=>
{
let
Id
=
parseInt
(
req
.
params
.
id
);
let
Id
=
parseInt
(
req
.
params
.
id
);
db
.
collection
(
'employees'
).
findOne
({
empId
:
Id
},{
projection
:{
_id
:
false
}})
db
.
collection
(
'employees'
).
findOne
({
empId
:
Id
},{
projection
:{
_id
:
false
}})
...
@@ -32,6 +33,13 @@ app.get('/employee/:id', (req, res) => {
...
@@ -32,6 +33,13 @@ app.get('/employee/:id', (req, res) => {
.
catch
(
error
=>
res
.
status
(
401
).
send
(
error
))
.
catch
(
error
=>
res
.
status
(
401
).
send
(
error
))
})
})
//to get activities to display
app
.
get
(
'/activities'
,
(
req
,
res
)
=>
{
db
.
collection
(
'activities_master'
).
find
().
toArray
()
.
then
(
result
=>
{
res
.
send
(
result
)
})
.
catch
(
error
=>
res
.
status
(
401
).
send
(
error
))
})
/*
/*
Example of post Data
Example of post Data
{
{
...
@@ -41,11 +49,6 @@ Example of post Data
...
@@ -41,11 +49,6 @@ Example of post Data
"searchText":"eng"
"searchText":"eng"
}*/
}*/
app
.
post
(
'/getreportees'
,
(
req
,
res
)
=>
{
app
.
post
(
'/getreportees'
,
(
req
,
res
)
=>
{
let
reporteesArray
=
req
.
body
.
reportees
||
[];
let
sortBy
=
req
.
body
.
sort
?
req
.
body
.
sort
.
type
||
"_id"
:
"_id"
let
sortByOrder
=
req
.
body
.
sort
?
parseInt
(
req
.
body
.
sort
.
order
)
||
1
:
1
;
let
page
=
req
.
body
.
page
?
parseInt
(
req
.
body
.
page
)
||
1
:
1
;
let
limit
=
req
.
body
.
perPage
?
parseInt
(
req
.
body
.
perPage
)
||
10
:
10
;
let
reporteesArray
=
req
.
body
.
reportees
||
[];
let
reporteesArray
=
req
.
body
.
reportees
||
[];
let
sortBy
=
req
.
body
.
sort
?
req
.
body
.
sort
.
type
||
"_id"
:
"_id"
let
sortBy
=
req
.
body
.
sort
?
req
.
body
.
sort
.
type
||
"_id"
:
"_id"
let
sortByOrder
=
req
.
body
.
sort
?
parseInt
(
req
.
body
.
sort
.
order
)
||
1
:
1
;
let
sortByOrder
=
req
.
body
.
sort
?
parseInt
(
req
.
body
.
sort
.
order
)
||
1
:
1
;
...
...
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