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

9 lines
327 B
JavaScript
Raw Normal View History

2022-04-24 07:27:28 +00:00
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()
}