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

export async function fetchList(query) {
    return xFetch('/api/admin/authorities' + '?' +serialize(query));
}

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

export async function updateItem(item) {
    return xFetch('/api/admin/authorities/'+item.id, {
        method: 'PUT',
        body: serialize(item)
    });
}
