remove elasticsearch

This commit is contained in:
2025-07-11 21:07:33 -03:00
parent ef2ba6d114
commit 6d3a400b74
7 changed files with 9 additions and 123 deletions

View File

@@ -1,11 +1,11 @@
from http import HTTPStatus
from aws_lambda_powertools.event_handler import Response, content_types
from aws_lambda_powertools.event_handler.api_gateway import Router
from glom import glom
from layercake.funcs import pick
from meilisearch import Client as Meilisearch
from api_gateway import JSONResponse
from config import MEILISEARCH_API_KEY, MEILISEARCH_HOST, USER_TABLE
router = Router()
@@ -19,7 +19,7 @@ def lookup(username: str):
if user := glom(r, 'hits.0', default=None):
return pick(('id', 'name', 'email', 'cognito__sub'), user)
return Response(
content_type=content_types.APPLICATION_JSON,
return JSONResponse(
body={'message': 'User not found.'},
status_code=HTTPStatus.NOT_FOUND,
)

View File

@@ -16,7 +16,7 @@ from middlewares import Tenant, TenantMiddleware
router = Router()
user_layer = DynamoDBPersistenceLayer(USER_TABLE, dynamodb_client)
order_layer = DynamoDBPersistenceLayer(ORDER_TABLE, dynamodb_client)
meili_client = Meilisearch(MEILISEARCH_HOST, MEILISEARCH_API_KEY) # noqa: F821
meili_client = Meilisearch(MEILISEARCH_HOST, MEILISEARCH_API_KEY)
@router.get(