From 8f5278eb443864910dd9c2131c992d71e3af2d20 Mon Sep 17 00:00:00 2001 From: kartofen Date: Fri, 26 Aug 2022 23:54:17 +0300 Subject: Big bang --- src/lib/image.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/lib/image.ts (limited to 'src/lib/image.ts') diff --git a/src/lib/image.ts b/src/lib/image.ts new file mode 100644 index 0000000..53d4c98 --- /dev/null +++ b/src/lib/image.ts @@ -0,0 +1,10 @@ +import { api } from './api'; + +export async function getImg(imgId: string) { + if(imgId == null || imgId == '' || imgId == undefined) return null; + + const response = await api('get', `image/${imgId}`) + + if(response.status !== 200) return `Server error: ${response.status}`; + return response.text(); +} -- cgit v1.2.3