Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViaResto-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aymeric Chaumont
ViaResto-website
Commits
363be2ef
Commit
363be2ef
authored
3 years ago
by
Aymeric Chaumont
Browse files
Options
Downloads
Patches
Plain Diff
update opening_hours routes paths
parent
55a05299
No related branches found
No related tags found
2 merge requests
!29
Time dependence
,
!28
improve front
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/routers/opening_hours.py
+5
-5
5 additions, 5 deletions
backend/routers/opening_hours.py
with
5 additions
and
5 deletions
backend/routers/opening_hours.py
+
5
−
5
View file @
363be2ef
...
...
@@ -6,24 +6,24 @@ from db import schemas, crud
from
db.database
import
get_db
router
=
APIRouter
(
prefix
=
"
/api
/opening_hours
"
,
tags
=
[
"
opening_hours
"
])
router
=
APIRouter
(
prefix
=
"
/api
"
,
tags
=
[
"
opening_hours
"
])
@router.get
(
'
/{place}
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
@router.get
(
'
/{place}
/opening_hours
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
async
def
get_opening_hours
(
place
:
str
,
page
:
int
=
1
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_opening_hours
(
place
,
page
,
db
)
@router.get
(
'
/{place}/{day}/{timeslot}
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
@router.get
(
'
/{place}/
opening_hours/
{day}/{timeslot}
'
,
response_model
=
List
[
schemas
.
OpeningHours
])
async
def
get_timeslot
(
place
:
str
,
day
:
int
,
timeslot
:
bool
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
get_timeslot
(
place
,
day
,
timeslot
,
db
)
@router.post
(
'
/{place}
'
,
response_model
=
schemas
.
OpeningHours
)
@router.post
(
'
/{place}
/opening_hours
'
,
response_model
=
schemas
.
OpeningHours
)
async
def
create_opening_hours
(
place
:
str
,
opening_hours
:
schemas
.
OpeningHoursBase
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
create_opening_hours
(
place
,
opening_hours
,
db
)
@router.delete
(
'
/{id}
'
,
response_model
=
None
)
@router.delete
(
'
/
opening_hours/
{id}
'
,
response_model
=
None
)
async
def
delete_opening_hours
(
id
:
int
,
db
:
Session
=
Depends
(
get_db
)):
return
crud
.
delete_opening_hours
(
id
,
db
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment