Skip to content

Commit 87b5b72

Browse files
author
Alex Silyuk
authored
small fixes
1 parent a9b52b8 commit 87b5b72

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ function printOneLocation(){
383383
}
384384

385385
function printAllLocations(){
386-
locations=$(curl -s "http://localhost/Locations/")
387-
length=$(curl -s "http://localhost/Locations/" | jq length)
386+
locations=$(curl -s "http://localhost/Locations/" )
387+
length=$(curl -s "http://localhost/Locations/" | jq .locations | jq length)
388388
for i in `seq 0 $length`;
389389
do
390390
current_movie="$(jq -r ".locations[$i]" <<< $locations)"
@@ -409,7 +409,7 @@ function printLocationByID(){
409409
function printLocationByCity(){
410410
if [ -n "$city" ];then
411411
locations=$(curl -s "http://localhost/Locations/city="$city"")
412-
length=$(curl -s "http://localhost/Locations/city="$city"" | jq length)
412+
length=$(curl -s "http://localhost/Locations/city="$city"" | jq .locations | jq length)
413413
for i in `seq 0 $length`;do
414414
current_movie="$(jq -r ".locations[$i]" <<< $locations)"
415415
printOneLocation "$current_movie"
@@ -424,7 +424,7 @@ function printLocationByCity(){
424424
function printLocationByCountry(){
425425
if [ -n "$country" ];then
426426
locations=$(curl -s "http://localhost/Locations/country="$country"")
427-
length=$(curl -s "http://localhost/Locations/country="$country"" | jq length)
427+
length=$(curl -s "http://localhost/Locations/country="$country"" |jq .locations | jq length)
428428
for i in `seq 0 $length`;do
429429
current_movie="$(jq -r ".locations[$i]" <<< $locations)"
430430
printOneLocation "$current_movie"

0 commit comments

Comments
 (0)