import api from "src/api";

export const forgotPassword = async (email) => {
  const { data } = await api.post("/forgot-password", { email, portal: "franchisor" });
  return data;
};

export const verifyPasswordCode = async (email, code) => {
  const { data } = await api.post("/forgot-password/verify-code", { email, code });
  return data;
};

export const confirmPassword = async (password) => {
  const { data } = await api.post("/confirm-password", { password });
  return data;
};

export const resetPassword = async (email, code, password, passwordConfirmation) => {
  const { data } = await api.post("/reset-password", {
    email,
    code,
    password,
    password_confirmation: passwordConfirmation,
  });
  return data;
};
