From 490c045595567c4af315aec5f4bf3be6ea536d24 Mon Sep 17 00:00:00 2001 From: ingalls Date: Thu, 10 Oct 2024 10:03:46 -0600 Subject: [PATCH] Auto Subscribe --- api/lib/data-mission.ts | 9 +++++++++ api/web/src/components/DataEdit.vue | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/lib/data-mission.ts b/api/lib/data-mission.ts index 14161a4b4..0e38cf50c 100644 --- a/api/lib/data-mission.ts +++ b/api/lib/data-mission.ts @@ -65,6 +65,15 @@ export default class DataMission { mission_token: mission.token || undefined }); + const conn = config.conns.get(data.connection); + if (conn) { + await api.Mission.subscribe(data.name, { + uid: conn.config.uid() + },{ + token: mission.token || undefined + }); + } + // The groups property isn't returned by Create // Make this second call to get the groups - TODO Talk to Josh mission = await api.Mission.get(data.name, {}, { diff --git a/api/web/src/components/DataEdit.vue b/api/web/src/components/DataEdit.vue index 9c70fddd0..c1923b55e 100644 --- a/api/web/src/components/DataEdit.vue +++ b/api/web/src/components/DataEdit.vue @@ -182,8 +182,8 @@ export default { auto_transform: true, mission_sync: true, mission_groups: [], - mission_role: 'MISSION_SUBSCRIBER', - mission_diff: false, + mission_role: 'MISSION_READONLY_SUBSCRIBER', + mission_diff: true, description: '', } }