From e5fbed7fa933d8548221a61d468a2d920cd1a573 Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Mon, 15 May 2023 11:50:07 +0200 Subject: [PATCH] company logos added --- company_generic.svg | 1 + stockingly-frontend/src/api/index.ts | 6 ++++- stockingly-frontend/src/views/Home.vue | 34 +++++++++++++++----------- stockingly.py | 11 +++++++++ 4 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 company_generic.svg diff --git a/company_generic.svg b/company_generic.svg new file mode 100644 index 0000000..c935139 --- /dev/null +++ b/company_generic.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/stockingly-frontend/src/api/index.ts b/stockingly-frontend/src/api/index.ts index 2dbc27e..61298e2 100644 --- a/stockingly-frontend/src/api/index.ts +++ b/stockingly-frontend/src/api/index.ts @@ -13,7 +13,11 @@ export interface Company { tags: string[]; ticker: string; website: string; + logoSrc: string } export const getCompanies = (): Promise => - fetch(BACKEND_URL + '/companies').then(r => r.json()) \ No newline at end of file + fetch(BACKEND_URL + '/companies').then(r => r.json()).then(list => list.map((e: Company) => ({ + ...e, + logoSrc: `${BACKEND_URL}/companies/logos/${e.ticker}` + }))); \ No newline at end of file diff --git a/stockingly-frontend/src/views/Home.vue b/stockingly-frontend/src/views/Home.vue index 6f9bff1..789b8d3 100644 --- a/stockingly-frontend/src/views/Home.vue +++ b/stockingly-frontend/src/views/Home.vue @@ -9,10 +9,16 @@