Skip to content

Commit

Permalink
make get settings route public
Browse files Browse the repository at this point in the history
  • Loading branch information
wuttinanhi committed Oct 31, 2022
1 parent 5d797ee commit a6af62e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions settings/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ class SettingDto(Schema):
@admin_only
def set_settings():
data = validate_request(SettingDto, request)
SettingService.set_settings(
Setting(
data.charge_within_hour,
data.charge_more_than_a_hour,
data.charge_more_than_a_day,
)
settings = Setting(
data.charge_within_hour,
data.charge_more_than_a_hour,
data.charge_more_than_a_day,
)
SettingService.set_settings(settings)
return {"message": "Setting complete."}, OK


@blueprint.route("/get", methods=["GET"])
@admin_only
def get_settings():
setting = SettingService.get_settings()
return setting.json()

0 comments on commit a6af62e

Please sign in to comment.