Projekt

Obecné

Profil

« Předchozí | Další » 

Revize a139ba77

Přidáno uživatelem Cajova-Houba před asi 7 roky(ů)

refs #6699: Pridany chybove kody k rest api end pointum.

Zobrazit rozdíly:

backend/app/Http/Controllers/DeviceController.php
26 26
            $showDirection = ($request->input('showDirection') === 1);
27 27
        }
28 28

  
29
        return Zarizeni::findByAddressJoinAddress($address);
29
        $device = Zarizeni::findByAddressJoinAddress($address);
30
        if ($device == null || count($device) == 0) {
31
            return response('Not found.', 404);
32
        }
33

  
34
        return $device;
30 35
    }
31 36

  
32 37
    /**
......
70 75
        $device = Zarizeni::findByIdJoinAddress($id);
71 76
        if ($device != null) {
72 77
            $device[0]->traffic = Zaznam::findByDevice($id, $dateFrom, $dateTo, $timeFrom, $timeTo, $direction);
78
        } else if ($device == null || count($device) == 0) {
79
            return response('Not found.', 404);
73 80
        }
74 81

  
75 82
        return $device;

Také k dispozici: Unified diff