mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
[Persistence] Retain original id
...after parsing out space and key, to aid in assembling the result of getModels as an object where IDs are keys.
This commit is contained in:
parent
944a5a7424
commit
fd4c1ea747
@ -84,9 +84,10 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Package the result as id->model
|
// Package the result as id->model
|
||||||
function packageResult(ids, models) {
|
function packageResult(parsedIds, models) {
|
||||||
var result = {};
|
var result = {};
|
||||||
ids.forEach(function (id, index) {
|
parsedIds.forEach(function (parsedId, index) {
|
||||||
|
var id = parsedId.id;
|
||||||
if (models[index]) {
|
if (models[index]) {
|
||||||
result[id] = models[index];
|
result[id] = models[index];
|
||||||
}
|
}
|
||||||
@ -113,8 +114,8 @@ define(
|
|||||||
parsedIds = ids.map(function (id) {
|
parsedIds = ids.map(function (id) {
|
||||||
var parts = id.split(":");
|
var parts = id.split(":");
|
||||||
return (parts.length > 1) ?
|
return (parts.length > 1) ?
|
||||||
{ space: parts[0], key: parts.slice(1).join(":") } :
|
{ id: id, space: parts[0], key: parts.slice(1).join(":") } :
|
||||||
{ space: defaultSpace, key: id };
|
{ id: id, space: defaultSpace, key: id };
|
||||||
});
|
});
|
||||||
|
|
||||||
return persistenceService.listSpaces()
|
return persistenceService.listSpaces()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user