databag/net/web/src/api/setProfileImage.js
2022-04-25 22:25:03 -07:00

9 lines
297 B
JavaScript

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()
}