import { getUrl, getAuthTokenHeader } from "../helper";
import { authedFunction } from "../session";

export const followerActions = {
	addFollower: async (contact, userID) => {
		const request = {
			method: "POST",
			url: getUrl("followers", "addFollower"),
			data: { contact, userID },
			headers: {},
		};
		request.headers.authorization = await getAuthTokenHeader();
		return authedFunction(request);
	},
	removeFollower: async (contactID, userID) => {
		const request = {
			method: "POST",
			url: getUrl("followers", "removeFollower"),
			data: { contactID, userID },
			headers: {},
		};
		request.headers.authorization = await getAuthTokenHeader();
		return authedFunction(request);
	},
	getFollowing: async () => {
		const request = {
			method: "GET",
			url: getUrl("followers", "getFollowing"),
		};
		return authedFunction(request);
	},
};
