Skip to content

Commit

Permalink
Refactor API routes and add new endpoints for Unicafe menus
Browse files Browse the repository at this point in the history
This commit refactors the API routes in the app.py file and adds two new endpoints for retrieving the menus of Unicafe restaurants. The UnicafeChemicum endpoint returns the menu for the Chemicum restaurant, while the UnicafeExactum endpoint returns the menu for the Exactum restaurant. This change improves the organization and functionality of the API.
  • Loading branch information
lamtonylam committed Oct 8, 2024
1 parent 8be22bd commit 26bdfc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
9 changes: 9 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,14 @@ class UnicafeGlobalSausageSearch(Resource):
def get(self):
return unicafe_global_sausagesearch()

class UnicafeChemicum(Resource):
def get(self):
return get_todays_menu("Chemicum")

class UnicafeExactum(Resource):
def get(self):
return get_todays_menu("Exactum")

api.add_resource(UnicafeGlobalSausageSearch, "/api")
api.add_resource(UnicafeChemicum, "/api/chemicum")
api.add_resource(UnicafeExactum, "/api/exactum")
19 changes: 1 addition & 18 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,6 @@ <h3>
<hr />
<p>Tänään on: {{ date }}.</p>
<p>Data haettu {{furtherst_date_data}} asti</p>

<!--
<ul class="list-group">
<li class="list-group-item">
<h2>
Mekuma Chemicumissa: {% if onko_makkaraa_chemicum %} ✅ {%
else %} ❌ {% endif %}
</h2>
</li>
<li class="list-group-item">
<h2>
Mekuma Exactumissa: {% if onko_makkaraa_exactum %} ✅ {%
else %} ❌ {% endif %}
</h2>
</li>
</ul>
-->
<!-- <br /> ... -->
{% if not chemcim_suljettu %}

<hr />
Expand Down Expand Up @@ -111,6 +93,7 @@ <h2>
<hr />
{% endif %}

<hr />
<div class="btn-group-vertical">
<a
class="btn btn-primary btn"
Expand Down

0 comments on commit 26bdfc5

Please sign in to comment.