Correctly handle error; don't overwrite laravel method

This commit is contained in:
Dane Everitt 2021-01-30 18:07:48 -08:00
parent 32fb21d0b7
commit f558bc880a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 4 additions and 3 deletions

View file

@ -101,7 +101,7 @@ class AuditLog extends Model
* *
* @return $this * @return $this
*/ */
public static function factory(string $action, array $metadata, bool $isSystem = false) public static function instance(string $action, array $metadata, bool $isSystem = false)
{ {
/** @var \Illuminate\Http\Request $request */ /** @var \Illuminate\Http\Request $request */
$request = Container::getInstance()->make('request'); $request = Container::getInstance()->make('request');

View file

@ -336,7 +336,7 @@ class Server extends Model
*/ */
public function newAuditEvent(string $action, array $metadata = []): AuditLog public function newAuditEvent(string $action, array $metadata = []): AuditLog
{ {
return AuditLog::factory($action, $metadata)->fill([ return AuditLog::instance($action, $metadata)->fill([
'server_id' => $this->id, 'server_id' => $this->id,
]); ]);
} }

View file

@ -71,7 +71,8 @@ export default ({ backup }: Props) => {
console.error(error); console.error(error);
clearAndAddHttpError({ key: 'backups', error }); clearAndAddHttpError({ key: 'backups', error });
}) })
.then(() => setLoading(false)); .then(() => setLoading(false))
.then(() => setModal(''));
}; };
return ( return (