mirror of
https://github.com/diced/zipline.git
synced 2025-12-22 07:10:39 -08:00
featL settings, view routes, embeds, etc.
This commit is contained in:
14
src/lib/hooks/useAvatar.ts
Normal file
14
src/lib/hooks/useAvatar.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import useSWR from 'swr';
|
||||
|
||||
const f = async () => {
|
||||
const res = await fetch('/api/user/avatar');
|
||||
if (!res.ok) return null;
|
||||
|
||||
const r = await res.text();
|
||||
return r;
|
||||
};
|
||||
|
||||
export default function useAvatar() {
|
||||
const { data, mutate } = useSWR('/api/user/avatar', f);
|
||||
return { avatar: data, mutate };
|
||||
}
|
||||
Reference in New Issue
Block a user