diff options
author | kartofen <mladenovnasko0@gmail.com> | 2022-08-26 23:54:17 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2022-08-26 23:54:17 +0300 |
commit | 8f5278eb443864910dd9c2131c992d71e3af2d20 (patch) | |
tree | d56d805fa010e4b10af7dec0ed359f218e859667 /src/lib/image.ts |
Big bang
Diffstat (limited to 'src/lib/image.ts')
-rw-r--r-- | src/lib/image.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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(); +} |