import { action } from 'mobx';
import client from 'client';
import Base from 'stores/base';
export class ShareInstanceStore extends Base {
get client() {
return client.manila.shareInstances;
}
get paramsFunc() {
return (params) => {
const { keywords, ...rest } = params;
return rest;
};
}
async detailDidFetch(item) {
const { id } = item || {};
const { export_locations = [] } = await this.client.exportLocations.list(
id
);
item.exportLocations = export_locations;
return item;
}
@action
forceDelete = ({ id }) => {
const body = {
force_delete: null,
};
return this.submitting(this.client.action(id, body));
};
@action
resetStatus(id, data) {
const body = {
reset_status: data,
};
return this.submitting(this.client.action(id, body));
}
}
const globalShareInstanceStore = new ShareInstanceStore();
export default globalShareInstanceStore;