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

export async function fetchList(query) {
    return xFetch('/api/customMessages' + '?' +serialize({s:30, ...query}));
}

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

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