Skip to content

Commit f91d414

Browse files
committed
fix: getToc search by last modification date
1 parent 7797944 commit f91d414

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

eln/Sample.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,24 @@ class Sample {
6767
}
6868

6969
async getToc() {
70-
let id = DataObject.resurrect(this.sample.$id).join(' ');
70+
// sample_toc is now expected to be based on last modification date
71+
let id = DataObject.resurrect(this.sample.modificationDate);
7172
let result = await this.roc.query('sample_toc', {
7273
key: id,
7374
filter: (entry) => {
7475
return entry.id === this.uuid;
7576
},
7677
});
78+
79+
if (result.length === 0) {
80+
id = DataObject.resurrect(this.sample.$id).join(' ');
81+
result = await this.roc.query('sample_toc', {
82+
key: id,
83+
filter: (entry) => {
84+
return entry.id === this.uuid;
85+
},
86+
});
87+
}
7788
if (result.length === 0) {
7889
result = await this.roc.query('sample_toc', {
7990
key: id.trimEnd(' '),

0 commit comments

Comments
 (0)