import http from '@/http';
import { API } from '@/http/api';
import { ICertificationRequest, ICertificationResponse } from '@/types/company';
import { requestUserInfo } from '@/utils/user';

export const postCertification = async (data: ICertificationRequest) => {
  const result = await http.post<ICertificationResponse>(API.CERTIFICATION, { data });
  await requestUserInfo();
  return result;
};

export const getPhone = async (code: string) => {
  return await http.post<{ phoneNumber: string }>(API.GET_PHONE, { data: { code } });
};
