import {postRequest, replaceInUrl } from './index';
import apiEndpoints from './apiEndpoints';


export const attemptLogin = (payload) =>
  postRequest(apiEndpoints.authentications.login, payload);

export const refreshTokenRequest = (payload) =>
  postRequest(apiEndpoints.authentications.refreshToken, payload);

export const logoutUserRequest = (userUid) =>
  postRequest(
    replaceInUrl(apiEndpoints.users.logout, {
      userUid,
    }),
  );

export const generateTokenRequest = (payload) =>
  postRequest(apiEndpoints.authentications.generateToken, payload);
