diff options
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(); +} |