Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-090
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
2021-090
2021-090
Commits
8f2fdda6
Commit
8f2fdda6
authored
Nov 09, 2021
by
IT18111170-Silva S.H.I
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated: gamification model
parent
ae107536
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
Agri_Backend/Agripreneur_App/Routes/Gamification.py
Agri_Backend/Agripreneur_App/Routes/Gamification.py
+29
-1
No files found.
Agri_Backend/Agripreneur_App/Routes/Gamification.py
View file @
8f2fdda6
...
@@ -90,7 +90,7 @@ def add_points_earns(id):
...
@@ -90,7 +90,7 @@ def add_points_earns(id):
"userID"
:
user_earns
}
"userID"
:
user_earns
}
dbResponse
=
db
.
CropData
.
insert_one
(
earnsData
)
dbResponse
=
db
.
CropData
.
insert_one
(
earnsData
)
return
Response
(
return
Response
(
response
=
json
.
dumps
({
"message"
:
"user points entered"
}),
response
=
json
.
dumps
({
"message"
:
"user points entered"
,
"earns"
:
earns
}),
status
=
200
,
status
=
200
,
)
)
...
@@ -104,6 +104,34 @@ def add_points_earns(id):
...
@@ -104,6 +104,34 @@ def add_points_earns(id):
)
)
@
app
.
route
(
"/getVal/<id>"
,
methods
=
[
"GET"
])
@
check_for_token
def
get_earn_val
(
id
):
request
.
headers
id
=
session
[
'Auth'
][
'_id'
]
try
:
dbResponse
=
db
.
CropData
.
find
({
"userID._id"
:
ObjectId
(
id
)},)
mongores
=
list
(
dbResponse
)
print
(
mongores
)
# data = list(db.users.find())
for
user
in
mongores
:
user
[
"earns"
]
=
str
(
user
[
"earns"
])
print
(
user
[
"earns"
])
return
Response
(
response
=
json
.
dumps
({
"message"
:
user
[
"earns"
]}),
status
=
200
,
)
except
Exception
as
Ex
:
print
(
"**********"
)
print
(
Ex
)
# @app.route("/getUsers", methods=["GET"])
# @app.route("/getUsers", methods=["GET"])
# def get_some_users():
# def get_some_users():
...
...
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