events are updated
This commit is contained in:
@@ -15,7 +15,7 @@ from api_validations.validations_request import (
|
||||
InsertPostCode,
|
||||
SearchAddress,
|
||||
)
|
||||
from api_validations.core_response import return_json_response_from_alchemy
|
||||
from api_validations.core_response import AlchemyJsonResponse
|
||||
from api_events.events.abstract_class import MethodToEvent, ActionsSchema
|
||||
from api_objects.auth.token_objects import EmployeeTokenObject, OccupantTokenObject
|
||||
|
||||
@@ -55,8 +55,10 @@ class AddressListEventMethods(MethodToEvent):
|
||||
records = Addresses.filter_active(
|
||||
*Addresses.get_smart_query(list_options.query)
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="List Address records",
|
||||
result=records,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -66,11 +68,12 @@ class AddressListEventMethods(MethodToEvent):
|
||||
token_dict=token_dict,
|
||||
filter_expr=Addresses.get_smart_query(list_options.query),
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="List Address records",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
class AddressCreateEventMethods(MethodToEvent):
|
||||
|
||||
event_type = "CREATE"
|
||||
@@ -345,8 +348,10 @@ class AddressPostCodeListEventMethods(MethodToEvent):
|
||||
records = AddressPostcode.filter_active(
|
||||
*Addresses.get_smart_query(list_options.query)
|
||||
)
|
||||
return return_json_response_from_alchemy(
|
||||
response=records, pagination=list_options
|
||||
return AlchemyJsonResponse(
|
||||
completed=True,
|
||||
message="List Address records",
|
||||
result=records,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user