Add ServerTransferringException, use is_null
This commit is contained in:
parent
5668a780e2
commit
fd848985ee
9 changed files with 36 additions and 14 deletions
|
@ -66,7 +66,7 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>)
|
|||
getServer(match.params.id)
|
||||
.catch(error => {
|
||||
if (error.response?.status === 409) {
|
||||
if (error.response.data?.errors[0]?.detail?.includes('transfer')) {
|
||||
if (error.response.data?.errors[0]?.code === 'ServerTransferringException') {
|
||||
setTransferring(true);
|
||||
} else {
|
||||
setInstalling(true);
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="suspend" />
|
||||
<button type="submit" class="btn btn-warning @if($server->transfer !== null) disabled @endif">Suspend Server</button>
|
||||
<button type="submit" class="btn btn-warning @if(! is_null($server->transfer)) disabled @endif">Suspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -97,7 +97,7 @@
|
|||
</div>
|
||||
@endif
|
||||
|
||||
@if($server->transfer === null)
|
||||
@if(is_null($server->transfer))
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue