Skip to content

Commit

Permalink
Merge pull request #202 from dfpc-coe/layer-content
Browse files Browse the repository at this point in the history
Layer Content
  • Loading branch information
ingalls authored Jun 20, 2024
2 parents 14866e9 + f2b52d4 commit 658a9de
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 343 deletions.
26 changes: 24 additions & 2 deletions api/lib/data-mission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,41 @@ export default class DataMission {

for (const l of layers.items) {
const exists = existMap.get(`layer-${l.id}`);

if (!exists) {
await api.MissionLayer.create(
data.name,
{
uid: `layer-${l.id}`,
name: l.name,
type: MissionLayerType.GROUP,
type: MissionLayerType.UID,
creatorUid: `connection-${data.connection}-data-${data.id}`
},
{ token: data.mission_token }
);
} else {
// Check for Layer Type Mismatch - not sure
if (exists.type !== MissionLayerType.UID) {
await api.MissionLayer.delete(
data.name,
{
uid: `layer-${l.id}`,
creatorUid: `connection-${data.connection}-data-${data.id}`
},
{ token: data.mission_token }
);

await api.MissionLayer.create(
data.name,
{
uid: `layer-${l.id}`,
name: l.name,
type: MissionLayerType.UID,
creatorUid: `connection-${data.connection}-data-${data.id}`
},
{ token: data.mission_token }
);
}

// Check for Name Mismatch - rename
}
}
Expand Down
Loading

0 comments on commit 658a9de

Please sign in to comment.