Skip to content

Commit

Permalink
fix: fix importvcard job (#5151)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored May 3, 2021
1 parent 56572bb commit cf8041c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function storeImport(ImportsRequest $request)
throw new AccountLimitException();
}

$filename = $request->file('vcard')->store('imports', 'public');
$filename = $request->file('vcard')->store('imports', config('filesystems.default'));

$importJob = $account->importjobs()->create([
'user_id' => auth()->user()->id,
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Account/ImportJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function fail(string $reason): void
private function getPhysicalFile()
{
try {
$this->physicalFile = Storage::disk('public')->readStream($this->filename);
$this->physicalFile = Storage::disk(config('filesystems.default'))->readStream($this->filename);
} catch (FileNotFoundException $exception) {
$this->fail(trans('settings.import_vcard_file_not_found'));
}
Expand All @@ -176,7 +176,7 @@ private function getPhysicalFile()
*/
private function deletePhysicalFile(): void
{
if (! Storage::disk('public')->delete($this->filename)) {
if (! Storage::disk(config('filesystems.default'))->delete($this->filename)) {
$this->fail(trans('settings.import_vcard_file_not_found'));
}
}
Expand Down

0 comments on commit cf8041c

Please sign in to comment.