Remove obsolete logic from location importer [SCI-11050]

This commit is contained in:
Martin Artnik 2024-09-13 15:34:46 +02:00
parent d6ca444f4a
commit ddc7cf9bf6
2 changed files with 5 additions and 8 deletions

View file

@ -133,7 +133,7 @@ class StorageLocationsController < ApplicationController
def import_container
result = StorageLocations::ImportService.new(@storage_location, params[:file], current_user).import_items
if result[:status] == :ok
if (result[:assigned_count] + result[:unassigned_count] + result[:updated_count]).positive?
if (result[:assigned_count] + result[:unassigned_count]).positive?
log_activity(
:storage_location_imported,
{

View file

@ -8,7 +8,6 @@ module StorageLocations
@storage_location = storage_location
@assigned_count = 0
@unassigned_count = 0
@updated_count = 0
@sheet = SpreadsheetParser.open_spreadsheet(file)
@user = user
end
@ -73,12 +72,10 @@ module StorageLocations
metadata: { position: row[:position] }
)
@assigned_count += 1 if storage_location_repository_row.new_record?
storage_location_repository_row.update!(
repository_row_id: row[:repository_row_id],
created_by: storage_location_repository_row.created_by || @user
)
if storage_location_repository_row.new_record?
@assigned_count += 1
storage_location_repository_row.update!(created_by: @user)
end
end
def unassign_repository_rows!