FIX get/post

This commit is contained in:
boyska 2020-12-15 15:21:03 +01:00
parent c36a1ea0cc
commit d929839025

View file

@ -68,7 +68,7 @@ def help():
) )
@app.get("/api/create") @app.post("/api/create")
def create(): def create():
req = dict(request.POST.decode().allitems()) req = dict(request.POST.decode().allitems())
ret = {} ret = {}
@ -87,7 +87,7 @@ def create():
) )
@app.get("/api/delete") @app.post("/api/delete")
def delete(): def delete():
req = dict(request.POST.decode().allitems()) req = dict(request.POST.decode().allitems())
logging.info("Server: request delete %s " % (req)) logging.info("Server: request delete %s " % (req))
@ -100,7 +100,7 @@ def delete():
return self.rec_err("DELETE error: %s" % (db.get_err())) return self.rec_err("DELETE error: %s" % (db.get_err()))
@app.get("/api/update/{recid}") @app.post("/api/update/{recid}")
def update(recid: int): def update(recid: int):
req = dict(request.POST.decode().allitems()) req = dict(request.POST.decode().allitems())
@ -126,7 +126,7 @@ def update(recid: int):
return self.rec_msg("Aggiornamento completato!", rec=rec_sanitize(result_rec)) return self.rec_msg("Aggiornamento completato!", rec=rec_sanitize(result_rec))
@app.get("/api/generate") @app.post("/api/generate")
def generate(): def generate():
# prendiamo la rec in causa # prendiamo la rec in causa
recid = dict(request.POST.decode().allitems())["id"] recid = dict(request.POST.decode().allitems())["id"]