//사용자 관리 - 데이터 api 연결

import { Axios } from '../utils';


export const InitData = async (token, params) => {
	try {
		const res = await Axios.post('/api/v1/data/init-data', params, {
			headers: { Authorization: `Bearer ${token}` },
		});

		return res.data;
	} catch (e) {
		if (e instanceof Error) {
			throw new Error('InitData Error', e);
		}
	}
};

export const InitHistoryList = async (token, params) => {
	try {
		const res = await Axios.post(`/api/v1/data/init-list`, params, {
			headers: { Authorization: `Bearer ${token}` },
		});

		return res.data;
	} catch (e) {
		if (e instanceof Error) {
			throw new Error('InitHistoryList Error', e);
		}
	}
};