chat: reducer handles metadata removal

This commit is contained in:
Matilde Park 2020-03-04 19:45:02 -05:00
parent ab793f1f70
commit 56d1630888

View File

@ -7,6 +7,7 @@ export class MetadataReducer {
this.associations(data, state); this.associations(data, state);
this.add(data, state); this.add(data, state);
this.update(data, state); this.update(data, state);
this.remove(data, state);
} }
} }
@ -39,4 +40,13 @@ export class MetadataReducer {
state.associations = metadata; state.associations = metadata;
} }
} }
remove(json, state) {
let data = _.get(json, 'remove', false);
if (data) {
let metadata = state.associations;
metadata.delete(data["app-path"]);
state.associations = metadata;
}
}
} }