remove elasticsearch
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user