"use server";

import { AddressesService } from "./api";

export const proceedGetStatesAsync = async (countryId: number) => {
  try {
    return await AddressesService.addressesControllerGetSates(countryId);
  } catch (error) {
    console.log("🚀 ~ proceedGetStatesAsync ~ error:", error);
    return null;
  }
};

export const proceedGetCitiesAsync = async (
  countryId: number,
  stateId: number,
) => {
  try {
    return await AddressesService.addressesControllerGetCities(
      countryId,
      stateId,
    );
  } catch (error) {
    console.log("🚀 ~ proceedGetCitiesAsync ~ error:", error);
    return null;
  }
};
