databag/net/web/src/Api/addCard.js

9 lines
287 B
JavaScript
Raw Normal View History

2022-04-05 18:39:18 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function addCard(token, message) {
let card = await fetchWithTimeout(`/contact/cards?agent=${token}`, { method: 'POST', body: JSON.stringify(message)} );
checkResponse(card);
return await card.json();
}