integrated images endpoint
This commit is contained in:
parent
48dd8d5179
commit
b6f8f8f234
Binary file not shown.
Binary file not shown.
|
|
@ -43,7 +43,7 @@ class Images(Resource):
|
||||||
|
|
||||||
session = Session()
|
session = Session()
|
||||||
image = session.query(Recipe.img).filter(Recipe.recipe_id == id).first()[0]
|
image = session.query(Recipe.img).filter(Recipe.recipe_id == id).first()[0]
|
||||||
image = base64.b64decode(image.encode())
|
image = base64.b64decode(image)
|
||||||
return flask.Response(image, mimetype='image/png')
|
return flask.Response(image, mimetype='image/png')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ def getRecDict2(indx, inputArr):
|
||||||
key2 = outDict[key]
|
key2 = outDict[key]
|
||||||
rec = dbSession.query(db.Recipe).filter(db.Recipe.recipe_id == key2).first()
|
rec = dbSession.query(db.Recipe).filter(db.Recipe.recipe_id == key2).first()
|
||||||
outDict2[key] = (key2, rec.name, rec.url, [r[0] + ": " + r[1] for r in dbSession.query(db.Ingredient.name,
|
outDict2[key] = (key2, rec.name, rec.url, [r[0] + ": " + r[1] for r in dbSession.query(db.Ingredient.name,
|
||||||
db.RecIngred.ingredient_amount).join(db.RecIngred).join(db.Recipe).filter(db.Recipe.recipe_id == key2).all()], rec.img.decode('utf-8'))
|
db.RecIngred.ingredient_amount).join(db.RecIngred).join(db.Recipe).filter(db.Recipe.recipe_id == key2).all()])
|
||||||
return outDict2
|
return outDict2
|
||||||
|
|
||||||
def stem(l1):
|
def stem(l1):
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ function renderRecipeList(data){
|
||||||
<div class="card-body recipe-container">
|
<div class="card-body recipe-container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-5 col-sm-5 col">
|
<div class="col-lg-5 col-sm-5 col">
|
||||||
<img class="recipe-img" src="data:image/png;base64,${data1[4]}">
|
<img class="recipe-img" src="/api/v1/images/${data1[0]}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg col-sm col">
|
<div class="col-lg col-sm col">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue