From 7775ffae1e631f8209fb8a5a3abf8bb05ca319ed Mon Sep 17 00:00:00 2001 From: Benjamin Nussbaum Date: Sat, 26 Apr 2025 16:29:07 +0200 Subject: [PATCH] fix: typo --- app/Models/Device.php | 2 +- resources/views/livewire/devices/configure.blade.php | 4 ++-- routes/api.php | 6 ++---- tests/Feature/Devices/DeviceTest.php | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/Models/Device.php b/app/Models/Device.php index 5c72ae8..291a04c 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -39,7 +39,7 @@ class Device extends Model return round($percent); } - public function getWifiStrenghAttribute() + public function getWifiStrengthAttribute() { $rssi = $this->last_rssi_level; if ($rssi >= 0) { diff --git a/resources/views/livewire/devices/configure.blade.php b/resources/views/livewire/devices/configure.blade.php index e2cefe4..b5778a3 100644 --- a/resources/views/livewire/devices/configure.blade.php +++ b/resources/views/livewire/devices/configure.blade.php @@ -236,9 +236,9 @@ new class extends Component { {{$device->last_firmware_version}} @endif - @if($device->wifiStrengh) + @if($device->wifiStrength) - @endif @if($device->batteryPercent) diff --git a/routes/api.php b/routes/api.php index bdc4c94..0d405fe 100644 --- a/routes/api.php +++ b/routes/api.php @@ -209,10 +209,8 @@ Route::get('/display/status', function (Request $request) { $deviceId = $request['device_id']; abort_unless($request->user()->devices->contains($deviceId), 403); - $device = Device::where('id', $deviceId)->get()->first(); - return response()->json( - $device->only([ + Device::find($deviceId)->only([ 'id', 'mac_address', 'name', @@ -221,7 +219,7 @@ Route::get('/display/status', function (Request $request) { 'last_battery_voltage', 'last_firmware_version', 'battery_percent', - 'wifi_strengh', + 'wifi_strength', 'current_screen_image', 'default_refresh_interval', 'updated_at', diff --git a/tests/Feature/Devices/DeviceTest.php b/tests/Feature/Devices/DeviceTest.php index ad12879..517be40 100644 --- a/tests/Feature/Devices/DeviceTest.php +++ b/tests/Feature/Devices/DeviceTest.php @@ -46,7 +46,7 @@ test('wifi strength is determined correctly', function () { 'last_rssi_level' => $case['rssi'], ]); - expect($device->wifi_strengh)->toBe($case['expected']) + expect($device->wifi_strength)->toBe($case['expected']) ->and($device->last_rssi_level)->toBe($case['rssi']); } });