diff --git a/webroot/api/packages.shs b/webroot/api/packages.shs index be4b4a5..d81a139 100644 --- a/webroot/api/packages.shs +++ b/webroot/api/packages.shs @@ -7,14 +7,5 @@ source code/common.sh data=$(curl -s -H "$(get_auth_string)" "https://api-inmobile-pl.easypack24.net/v1/parcel?updatedAfter=1970-01-01T00:00:00.000Z") -IFS=$'\n' -shipmentNumber=($(echo $data | jq -cr .[].shipmentNumber)) -expiryDate=($(echo $data | jq -cr .[].expiryDate)) -openCode=($(echo $data | jq -cr .[].openCode)) -pickupPointLocation=($(echo $data | jq -cr .[].pickupPoint.location)) -pickupPointName=($(echo $data | jq -cr .[].pickupPoint.name)) -senderName=($(echo $data | jq -cr .[].senderName)) -for i in ${pickupPointLocation[@]}; do - echo $i; -done \ No newline at end of file +echo $data | jq -c "[.[] | {shipmentNumber: .shipmentNumber, status: .status, openCode: .openCode, senderName: .senderName, pickupPoint: {name: .pickupPoint.name, status: .pickupPoint.status, location: .pickupPoint.location, description: .pickupPoint.locationDescription, address: .pickupPoint.addressDetails}}]" \ No newline at end of file