databag/net/web/src/api/setProfileImage.js

9 lines
297 B
JavaScript
Raw Normal View History

2022-04-24 02:49:27 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function setProfileImage(token, image) {
let profile = await fetchWithTimeout(`/profile/image?agent=${token}`, { method: 'PUT', body: JSON.stringify(image) });
checkResponse(profile)
return await profile.json()
}