import axios from "axios";

const BASE_URL = "https://openplate.my.id/api";

const api = axios.create({
  baseURL: BASE_URL,
  headers: {
    "Content-Type": "application/json",
  },
  timeout: 10000,
});

export const getUsers = async () => {
  try {

    const response = await api.get("/users.php");

    return response.data;

  } catch (error) {

    console.error("ERROR GET USERS:", error);

    return {
      success: false,
      message: "Tidak bisa terhubung ke server",
      data: [],
    };
  }
};