Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
Shoppe
Project
Project
Details
Activity
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
mongo101
Shoppe
Commits
9369fb5f
Commit
9369fb5f
authored
5 years ago
by
Ahmad Anvari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add order
parent
77b5a6d5
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
order.py
routes/order.py
+2
-2
No files found.
routes/order.py
View file @
9369fb5f
from
app
import
app
from
app
import
app
from
middlewares.auth
import
login_required
from
middlewares.auth
import
login_required
from
flask
import
request
,
jsonify
from
flask
import
request
,
jsonify
,
g
from
db.product
import
Product
from
db.product
import
Product
from
db.order
import
Order
from
db.order
import
Order
...
@@ -26,7 +26,7 @@ from db.order import Order
...
@@ -26,7 +26,7 @@ from db.order import Order
def
add_order
():
def
add_order
():
body
=
request
.
json
body
=
request
.
json
product_id
=
body
[
"product_id"
]
product_id
=
body
[
"product_id"
]
user_id
=
request
.
user
.
get_id
()
user_id
=
g
.
user
.
get_id
()
o
=
Order
(
user_id
=
user_id
,
product_id
=
product_id
)
o
=
Order
(
user_id
=
user_id
,
product_id
=
product_id
)
id
=
o
.
store
()
id
=
o
.
store
()
return
jsonify
({
"id"
:
id
})
return
jsonify
({
"id"
:
id
})
This diff is collapsed.
Click to expand it.
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