mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 18:07:41 -08:00
Added created by to the import itself
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
d4018a2834
commit
1aef7edc43
|
@ -42,6 +42,7 @@ class ItemImportRequest extends FormRequest
|
||||||
$classString = "App\\Importer\\{$class}Importer";
|
$classString = "App\\Importer\\{$class}Importer";
|
||||||
$importer = new $classString($filename);
|
$importer = new $classString($filename);
|
||||||
$import->field_map = request('column-mappings');
|
$import->field_map = request('column-mappings');
|
||||||
|
$import->created_by = auth()->id();
|
||||||
$import->save();
|
$import->save();
|
||||||
$fieldMappings = [];
|
$fieldMappings = [];
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ class ItemImportRequest extends FormRequest
|
||||||
$fieldMappings = array_change_key_case(array_flip($import->field_map), CASE_LOWER);
|
$fieldMappings = array_change_key_case(array_flip($import->field_map), CASE_LOWER);
|
||||||
}
|
}
|
||||||
$importer->setCallbacks([$this, 'log'], [$this, 'progress'], [$this, 'errorCallback'])
|
$importer->setCallbacks([$this, 'log'], [$this, 'progress'], [$this, 'errorCallback'])
|
||||||
->setUserId(auth()->id())
|
->setCreatedBy(auth()->id())
|
||||||
->setUpdating($this->get('import-update'))
|
->setUpdating($this->get('import-update'))
|
||||||
->setShouldNotify($this->get('send-welcome'))
|
->setShouldNotify($this->get('send-welcome'))
|
||||||
->setUsernameFormat('firstname.lastname')
|
->setUsernameFormat('firstname.lastname')
|
||||||
|
|
Loading…
Reference in a new issue