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

export async function fetchList(query) {
    return xFetch('/api/admin/authorities' + '?' + serialize({s: 30, ...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)
    });
}
//sessionStorage
