Connecting modals where needed
This commit is contained in:
@ -88,13 +88,15 @@ class Collection extends BaseModel {
|
||||
|
||||
@action delete = async () => {
|
||||
try {
|
||||
const res = await client.post('/collections.delete', { id: this.id });
|
||||
invariant(res && res.data, 'Data should be available');
|
||||
const { data } = res;
|
||||
return data.success;
|
||||
await client.post('/collections.delete', { id: this.id });
|
||||
this.emit('collections.delete', {
|
||||
id: this.id,
|
||||
});
|
||||
return true;
|
||||
} catch (e) {
|
||||
this.errors.add('Collection failed to delete');
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
updateData(data: Object = {}) {
|
||||
|
Reference in New Issue
Block a user