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

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

export async function updateItem(data) {
    const id = data.id;
    delete data.id;
    return xFetch('/api/contacts/' + id, {
        method:'PUT',
        body: serialize(data)
    });
}
