databag/app/mobile/src/api/getCard.js

10 lines
313 B
JavaScript
Raw Normal View History

2022-10-25 15:58:12 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function getCard(server, token, cardId) {
let param = "?agent=" + token
let card = await fetchWithTimeout(`https://${server}/contact/cards/${cardId}${param}`, { method: 'GET' });
checkResponse(card);
return await card.json()
}