... | @@ -480,26 +480,26 @@ A legacy document with multiple gene specifications will be fully archived when |
... | @@ -480,26 +480,26 @@ A legacy document with multiple gene specifications will be fully archived when |
|
|
|
|
|
|
|
|
|
For instance, given below is an example where the above logic is applied to the end point mentioned in step(1).
|
|
For instance, given below is an example where the above logic is applied to the end point mentioned in step(1).
|
|
<pre>let currentVersions = []
|
|
<pre>
|
|
if( respObj && respObj.status && respObj.status === 200 ) {
|
|
let currentVersions = []
|
|
const sviObj = respObj.data.data
|
|
if( respObj && respObj.status && respObj.status === 200 ) {
|
|
let released = undefined
|
|
const sviObj = respObj.data.data
|
|
for(const svi of sviObj){
|
|
for(const svi of sviObj){
|
|
if(svi.entContent.states) {
|
|
if(svi.entContent.states) {
|
|
const stateNames = svi.entContent.states.map((x) => x.name);
|
|
const stateNames = svi.entContent.states.map((x) => x.name);
|
|
if(stateNames.includes("Released")) {
|
|
if(stateNames.includes("Released")) { // has been approved
|
|
if(svi.entContent.legacyFullySuperseded === false || svi.entContent.legacyReplaced === true) {
|
|
if(svi.entContent.legacyFullySuperseded === false || svi.entContent.legacyReplaced === true) {
|
|
// drop the ones that have not been superseded yet or the ones that have been fully replaced.
|
|
// drop the doc that has not superseded the legacy yet or the ones that have been fully replaced.
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
currentVersions.push(svi.entId)
|
|
currentVersions.push(svi.entId)
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
global.brl.log( 'info', __filename, 'main', `CURRENT VERSION. ${global.brl.inspc(currentVersions.length)}` )</pre>
|
|
}
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
### [Markdown support for Criteria Code Specifications](Markdown-and-Citations) |
|
### [Markdown support for Criteria Code Specifications](Markdown-and-Citations) |
|
|
|
\ No newline at end of file |