<script>
import { ref } from "vue";
import { authenticatedRequest } from "@/components/session/authenticatedRequest.vue";
import { parseError } from "@/components/request/HandleGlobalError.vue";

export const code = {
  getCode: async (customer_number) => {
    return await authenticatedRequest("/admin/customer/code?customer_number=" + customer_number, "GET")
      .then((response) => {
        return response.data.data.code;
      })
      .catch((error) => {
        parseError(error, "auth");
        console.error(error);
      });
  },
}
</script>