mirror of
https://github.com/flarum/framework.git
synced 2025-01-06 02:23:36 +08:00
Fix errors in DeleteAvatarAction/Command
This commit is contained in:
parent
eb403d7bae
commit
927f6e3c9b
|
@ -41,7 +41,7 @@ class DeleteAvatarAction extends SerializeResourceAction
|
||||||
protected function data(JsonApiRequest $request, JsonApiResponse $response)
|
protected function data(JsonApiRequest $request, JsonApiResponse $response)
|
||||||
{
|
{
|
||||||
return $this->bus->dispatch(
|
return $this->bus->dispatch(
|
||||||
new DeleteAvatarCommand($request->get('id'), $this->actor->getUser())
|
new DeleteAvatarCommand($request->get('id'), $request->actor->getUser())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,11 +78,17 @@ class CoreServiceProvider extends ServiceProvider
|
||||||
'Flarum\Core\Repositories\EloquentActivityRepository'
|
'Flarum\Core\Repositories\EloquentActivityRepository'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$avatarFilesystem = function (Container $app) {
|
||||||
|
return $app->make('Illuminate\Contracts\Filesystem\Factory')->disk('flarum-avatars')->getDriver();
|
||||||
|
};
|
||||||
|
|
||||||
$this->app->when('Flarum\Core\Handlers\Commands\UploadAvatarCommandHandler')
|
$this->app->when('Flarum\Core\Handlers\Commands\UploadAvatarCommandHandler')
|
||||||
->needs('League\Flysystem\FilesystemInterface')
|
->needs('League\Flysystem\FilesystemInterface')
|
||||||
->give(function (Container $app) {
|
->give($avatarFilesystem);
|
||||||
return $app->make('Illuminate\Contracts\Filesystem\Factory')->disk('flarum-avatars')->getDriver();
|
|
||||||
});
|
$this->app->when('Flarum\Core\Handlers\Commands\DeleteAvatarCommandHandler')
|
||||||
|
->needs('League\Flysystem\FilesystemInterface')
|
||||||
|
->give($avatarFilesystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registerGambits()
|
public function registerGambits()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user