diff --git a/seed/static/seed/js/controllers/inventory_group_detail_meters_controller.js b/seed/static/seed/js/controllers/inventory_group_detail_meters_controller.js index 6f046b9516..22907ae6af 100644 --- a/seed/static/seed/js/controllers/inventory_group_detail_meters_controller.js +++ b/seed/static/seed/js/controllers/inventory_group_detail_meters_controller.js @@ -202,7 +202,7 @@ angular.module('SEED.controller.inventory_group_detail_meters', []) controller: 'meter_deletion_modal_controller', resolve: { organization_id: () => $scope.organization.id, - group_id: () => meter.service_group, + group_id: () => meter.config.group_id, meter: () => meter, view_id: () => view_id, refresh_meters_and_readings: () => $scope.refresh_meters_and_readings diff --git a/seed/static/seed/js/controllers/meter_deletion_modal_controller.js b/seed/static/seed/js/controllers/meter_deletion_modal_controller.js index a5b00c6984..2f03e52c49 100644 --- a/seed/static/seed/js/controllers/meter_deletion_modal_controller.js +++ b/seed/static/seed/js/controllers/meter_deletion_modal_controller.js @@ -30,7 +30,13 @@ angular.module('SEED.controller.meter_deletion_modal', []).controller('meter_del $scope.delete_meter = () => { spinner_utility.show(); - meter_service.delete_meter(organization_id, meter.id, view_id, group_id).then(() => { + let delete_promise; + if (view_id) { + delete_promise = meter_service.delete_property_meter(organization_id, meter.id, view_id) + } else{ + delete_promise = meter_service.delete_group_meter(organization_id, meter.id, group_id) + } + delete_promise.then(() => { refresh_meters_and_readings(); spinner_utility.show(); $uibModalInstance.dismiss('cancel'); diff --git a/seed/views/v3/inventory_groups.py b/seed/views/v3/inventory_groups.py index 99fbac3c87..b3ba030ffe 100644 --- a/seed/views/v3/inventory_groups.py +++ b/seed/views/v3/inventory_groups.py @@ -245,7 +245,7 @@ def create(self, request, inventory_group_pk): meter_serializer = MeterSerializer( data={ **request.data, - "connection_type": "From Outside", + "connection_type": "Imported", "source": "Manual Entry", } )