mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix issue updating categories.
This commit is contained in:
parent
136af9625a
commit
4aec1f06e0
@ -267,6 +267,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
{
|
||||
/** @var CategoryUpdateService $service */
|
||||
$service = app(CategoryUpdateService::class);
|
||||
$service->setUser($this->user);
|
||||
|
||||
return $service->update($category, $data);
|
||||
}
|
||||
|
@ -35,6 +35,9 @@ use Log;
|
||||
*/
|
||||
class CategoryUpdateService
|
||||
{
|
||||
private $user;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
@ -43,6 +46,9 @@ class CategoryUpdateService
|
||||
if ('testing' === config('app.env')) {
|
||||
Log::warning(sprintf('%s should not be instantiated in the TEST environment!', get_class($this)));
|
||||
}
|
||||
if(auth()->check()) {
|
||||
$this->user = auth()->user();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,4 +112,12 @@ class CategoryUpdateService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $user
|
||||
*/
|
||||
public function setUser($user): void
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user