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
a38e9755
Commit
a38e9755
authored
Mar 22, 2024
by
=sankoju Ravi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getActivities for reports
parent
2d4921d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
server.js
server.js
+6
-1
No files found.
server.js
View file @
a38e9755
...
@@ -248,11 +248,12 @@ const calculateAverage = async(query) => {
...
@@ -248,11 +248,12 @@ const calculateAverage = async(query) => {
page:0
page:0
perPage:10,
perPage:10,
"types":["duties","initiative"]
"types":["duties","initiative"]
getAll:true //send only for get all records
}
}
*/
*/
app
.
post
(
"/getActivities"
,
async
(
req
,
res
)
=>
{
app
.
post
(
"/getActivities"
,
async
(
req
,
res
)
=>
{
let
{
empId
,
today
,
types
}
=
req
.
body
;
let
{
empId
,
today
,
types
,
getAll
}
=
req
.
body
;
if
(
!
empId
||
typeof
empId
==
"string"
)
{
if
(
!
empId
||
typeof
empId
==
"string"
)
{
res
.
status
(
401
).
json
({
message
:
"Employee id is missing / EmpId should be string only"
});
res
.
status
(
401
).
json
({
message
:
"Employee id is missing / EmpId should be string only"
});
return
;
return
;
...
@@ -284,6 +285,10 @@ app.post("/getActivities", async(req, res) => {
...
@@ -284,6 +285,10 @@ app.post("/getActivities", async(req, res) => {
if
(
types
&&
types
?.
length
)
if
(
types
&&
types
?.
length
)
aggreGate
.
push
({
$match
:{
"activities.type"
:
{
"$in"
:
types
}
}
});
aggreGate
.
push
({
$match
:{
"activities.type"
:
{
"$in"
:
types
}
}
});
//console.log(JSON.stringify(aggreGate));
//console.log(JSON.stringify(aggreGate));
if
(
getAll
){
skip
=
0
;
limit
=
1000000
;
}
let
facet
=
{
let
facet
=
{
data
:
[{
$skip
:
skip
},
{
$limit
:
limit
}],
data
:
[{
$skip
:
skip
},
{
$limit
:
limit
}],
...
...
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