Minor fixes for documents

This commit is contained in:
David Bomba 2020-06-22 21:32:10 +10:00
parent 0b2e1ebdf0
commit 7af826fa7f
3 changed files with 18 additions and 18 deletions

View File

@ -64,22 +64,22 @@ class Handler extends ExceptionHandler
if (app()->bound('sentry') && $this->shouldReport($exception)) { if (app()->bound('sentry') && $this->shouldReport($exception)) {
// app('sentry')->configureScope(function (Scope $scope): void { app('sentry')->configureScope(function (Scope $scope): void {
// if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) { if (auth()->guard('contact') && auth()->guard('contact')->user() && auth()->guard('contact')->user()->company->account->report_errors) {
// $scope->setUser([ $scope->setUser([
// 'id' => auth()->guard('contact')->user()->company->account->key, 'id' => auth()->guard('contact')->user()->company->account->key,
// 'email' => "anonymous@example.com", 'email' => "anonymous@example.com",
// 'name' => "Anonymous User", 'name' => "Anonymous User",
// ]); ]);
// } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) { } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) {
// $scope->setUser([ $scope->setUser([
// 'id' => auth()->user()->account->key, 'id' => auth()->user()->account->key,
// 'email' => "anonymous@example.com", 'email' => "anonymous@example.com",
// 'name' => "Anonymous User", 'name' => "Anonymous User",
// ]); ]);
// } }
// }); });
app('sentry')->captureException($exception); app('sentry')->captureException($exception);
} }

View File

@ -94,8 +94,8 @@ class UploadFile implements ShouldQueue
$document->disk = $this->disk; $document->disk = $this->disk;
$document->hash = $this->file->hashName(); $document->hash = $this->file->hashName();
$document->size = $this->file->getSize(); $document->size = $this->file->getSize();
$document->width = isset($width) ?? null; $document->width = isset($width) ? $width : null;
$document->height = isset($height) ?? null; $document->height = isset($height) ? $height : null;
// $preview_path = $this->encodePrimaryKey($this->company->id); // $preview_path = $this->encodePrimaryKey($this->company->id);
// $document->preview = $this->generatePreview($preview_path); // $document->preview = $this->generatePreview($preview_path);

View File

@ -37,7 +37,7 @@ class DocumentTransformer extends EntityTransformer
'assigned_user_id' => $this->encodePrimaryKey($document->assigned_user_id), 'assigned_user_id' => $this->encodePrimaryKey($document->assigned_user_id),
'project_id' => $this->encodePrimaryKey($document->project_id), 'project_id' => $this->encodePrimaryKey($document->project_id),
'vendor_id' => $this->encodePrimaryKey($document->vendor_id), 'vendor_id' => $this->encodePrimaryKey($document->vendor_id),
'url' => (string) $document->url ?: '', 'url' => (string) $document->generateUrl() ?: '',
'preview' => (string) $document->preview ?: '', 'preview' => (string) $document->preview ?: '',
'name' => (string) $document->name, 'name' => (string) $document->name,
'type' => (string) $document->type, 'type' => (string) $document->type,