databag/app/mobile/api/getContactProfile.js

14 lines
368 B
JavaScript
Raw Normal View History

2022-09-07 07:32:06 +00:00
import { checkResponse, fetchWithTimeout } from './fetchUtil';
export async function getContactProfile(server, guid, token) {
let host = "";
if (server) {
host = `https://${server}`;
}
let profile = await fetchWithTimeout(`${host}/profile/message?contact=${guid}.${token}`, { method: 'GET', });
checkResponse(profile);
return await profile.json()
}