import xFetch from './xFetch';
import {serialize} from '../utils';

export async function fetchList(query) {
    const data = {...query};
    return xFetch('/api/customMessages' + '?' + serialize(data));
}

export async function fetchItem(id) {
    return xFetch('/api/customMessages/' + id);
}

export async function createItem(item) {
    return xFetch('/api/customMessages', {
        method: 'POST',
        body: serialize(item)
    });
}
