UNPKG

@chayns-components/person-finder

Version:

A set of beautiful React components for developing your own applications with chayns.

29 lines (28 loc) 765 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.postFriends = void 0; var _chaynsApi = require("chayns-api"); const URL = 'https://webapi.tobit.com/AccountService/v1.0/chayns/friends?friend=##personId##'; const postFriends = async personId => { const { accessToken } = await (0, _chaynsApi.getAccessToken)(); if (!accessToken) { return undefined; } const requestInit = { headers: { Authorization: `Bearer ${accessToken}` }, method: 'POST' }; const response = await fetch(URL.replace('##personId##', personId), requestInit); if (response.status === 200) { return await response.json(); } return undefined; }; exports.postFriends = postFriends; //# sourceMappingURL=post.js.map