From 10e804babc2d8955d8ab392ef0bb9e3bf4d676ea Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Wed, 8 Feb 2023 14:21:38 -0300 Subject: [PATCH] Fix historico so it uses an object as parameter --- nombres/build.sh | 4 ++-- nombres/historico/handler.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nombres/build.sh b/nombres/build.sh index 8f9bd97..7e8fed3 100755 --- a/nombres/build.sh +++ b/nombres/build.sh @@ -7,9 +7,9 @@ docker run --rm --privileged \ --reset -p yes # Build and deploy -if [ ! -d templates] +if [ ! -d template ] then - faas-cli template store pull python3-http + faas-cli template store pull python3-flask fi faas-cli publish -f nombres.yml --platforms linux/arm64 --build-arg 'TEST_ENABLED=false' faas-cli deploy -f nombres.yml diff --git a/nombres/historico/handler.py b/nombres/historico/handler.py index 57a2c44..ca78b3a 100644 --- a/nombres/historico/handler.py +++ b/nombres/historico/handler.py @@ -26,12 +26,13 @@ def handle(req): Args: req (str): request body - [nombre1, nombre2, ... nombreN] + {"i": ["nombre1, nombre2"]} """ nombres = [] try: nombres = loads(req) + nombres = nombres["i"].split(",") nombres = [remove_accents(x.strip().lower()) for x in nombres] nombres = [n for n in nombres if n] except Exception: