databag/app/mobile/api/addCard.js

9 lines
287 B
JavaScript
Raw Normal View History

2022-09-07 07:32:06 +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();
}