Skip to content

Commit

Permalink
Rename applications endpoint (#3879) (patch)
Browse files Browse the repository at this point in the history
### Fixed

- applications/order_type endpoint renamed
  • Loading branch information
islean authored Oct 23, 2024
1 parent 14ee10b commit 9860d34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cg/server/endpoints/applications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from http import HTTPStatus
from typing import Any

from flask import Blueprint, abort, jsonify, make_response
from flask import Blueprint, abort, jsonify, make_response, request

from cg.models.orders.constants import OrderType
from cg.server.endpoints.error_handler import handle_missing_entries
Expand All @@ -23,10 +23,11 @@ def get_applications():
return jsonify(applications=parsed_applications)


@APPLICATIONS_BLUEPRINT.route("/applications/<order_type>")
@APPLICATIONS_BLUEPRINT.route("/applications/order_type")
@handle_missing_entries
def get_application_order_types(order_type: OrderType):
def get_application_order_types():
"""Return application order types."""
order_type = OrderType(request.args.get("order_type"))
applications: ApplicationResponse = applications_service.get_valid_applications(order_type)
return jsonify(applications.model_dump())

Expand Down
2 changes: 1 addition & 1 deletion cg/services/application/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def get_valid_applications(self, order_type: OrderType) -> ApplicationResponse:
applications: list[Application] = self.store.get_active_applications_by_order_type(
order_type
)
app_tags: list[str] = [application.tag for application in applications]
app_tags: list[str] = sorted([application.tag for application in applications])
return create_application_response(app_tags)

0 comments on commit 9860d34

Please sign in to comment.