From 7131c13500dfaa754acc82c008bc0cb64833cef9 Mon Sep 17 00:00:00 2001 From: Christian Georgi Date: Thu, 17 Sep 2020 12:45:18 +0300 Subject: [PATCH] Add bookshop image streaming impl --- bookshop/app/vue/app.js | 3 ++- bookshop/app/vue/index.html | 4 ++++ bookshop/db/schema.cds | 1 + bookshop/test/requests.http | 29 +++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/bookshop/app/vue/app.js b/bookshop/app/vue/app.js index 7e8fb4b2..3dd4a2b7 100644 --- a/bookshop/app/vue/app.js +++ b/bookshop/app/vue/app.js @@ -25,7 +25,8 @@ const books = new Vue ({ async inspect () { const book = books.book = books.list [event.currentTarget.rowIndex-1] - book.descr || await GET(`/Books/${book.ID}/descr/$value`) .then (({data}) => book.descr = data) + book.imageSrc || await GET(`/Books/${book.ID}/image`) .then (({data}) => book.imageSrc = data ) + book.descr || await GET(`/Books/${book.ID}/descr/$value`) .then (({data}) => book.descr = data) books.order = { amount:1 } setTimeout (()=> $('form > input').focus(), 111) }, diff --git a/bookshop/app/vue/index.html b/bookshop/app/vue/index.html index cfae7d80..51408d43 100644 --- a/bookshop/app/vue/index.html +++ b/bookshop/app/vue/index.html @@ -37,6 +37,10 @@ +
+ +
+