//운영서비스 관리 - 아이템 리스트 api 연결

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

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

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

export const ItemDeleteAPI = async (token, params) => {
	try {
		const res = await Axios.delete(`/api/v1/items/delete`, {
			headers: { Authorization: `Bearer ${token}` },
			data: params,
		});

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