mirror of
https://github.com/nasa/openmct.git
synced 2025-06-04 00:20:50 +00:00
Accept plans from a file OR from JSON object (couchDB) (#3729)
Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
parent
03abb5e5de
commit
e70a636073
@ -1,10 +1,14 @@
|
|||||||
export function getValidatedPlan(domainObject) {
|
export function getValidatedPlan(domainObject) {
|
||||||
let jsonString = domainObject.selectFile.body;
|
let body = domainObject.selectFile.body;
|
||||||
let json = {};
|
let json = {};
|
||||||
try {
|
if (typeof body === 'string') {
|
||||||
json = JSON.parse(jsonString);
|
try {
|
||||||
} catch (e) {
|
json = JSON.parse(body);
|
||||||
return json;
|
} catch (e) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
json = body;
|
||||||
}
|
}
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user