Skip to content
Snippets Groups Projects
Commit d90b0c40 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Implement remove operation for CorpusFileLists

parent 009ee436
Branches
Tags
No related merge requests found
......@@ -225,7 +225,7 @@ class CorpusFileList extends RessourceList {
}
patch(patch) {
let re;
let id, match, re;
for (let operation of patch) {
switch(operation.op) {
case 'add':
......@@ -233,6 +233,14 @@ class CorpusFileList extends RessourceList {
re = new RegExp('^/corpora/' + this.corpus.id + '/files/(\\d+)$');
if (re.test(operation.path)) {this.add(operation.value);}
break;
case 'remove':
// See case add ;)
re = new RegExp('^/corpora/' + this.corpus.id + '/files/(\\d+)$');
if (re.test(operation.path)) {
[match, id] = operation.path.match(re);
this.remove(id);
}
break;
default:
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment