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

9 lines
327 B
JavaScript

import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function setCardProfile(token, cardId, message) {
let profile = await fetchWithTimeout(`/contact/cards/${cardId}/profile?agent=${token}`, { method: 'PUT', body: JSON.stringify(message) });
checkResponse(profile);
return await profile.json()
}