@camstack/system 1.2.174 → 1.2.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3429,6 +3429,7 @@ async function migrateDevice(pctx, input) {
|
|
|
3429
3429
|
const { sourceId, targetId } = input;
|
|
3430
3430
|
const ctx = pctx.host.ctx;
|
|
3431
3431
|
return await pctx.metaStore.withMetaWriteLock(async () => {
|
|
3432
|
+
for (const id of [sourceId, targetId]) if (await pctx.metaStore.rows.get(id) === null) throw new Error(`[device-manager] migrateDevice: device ${id} does not exist`);
|
|
3432
3433
|
const tempId = await pctx.metaStore.allocateNextDeviceId();
|
|
3433
3434
|
return await migrateDevice$1({
|
|
3434
3435
|
setSwitch: async (deviceId, switchId, enabled) => {
|
|
@@ -3424,6 +3424,7 @@ async function migrateDevice(pctx, input) {
|
|
|
3424
3424
|
const { sourceId, targetId } = input;
|
|
3425
3425
|
const ctx = pctx.host.ctx;
|
|
3426
3426
|
return await pctx.metaStore.withMetaWriteLock(async () => {
|
|
3427
|
+
for (const id of [sourceId, targetId]) if (await pctx.metaStore.rows.get(id) === null) throw new Error(`[device-manager] migrateDevice: device ${id} does not exist`);
|
|
3427
3428
|
const tempId = await pctx.metaStore.allocateNextDeviceId();
|
|
3428
3429
|
return await migrateDevice$1({
|
|
3429
3430
|
setSwitch: async (deviceId, switchId, enabled) => {
|