diff --git a/postman/collections/Fleetbase Storefront API/Food Trucks/Query Food Trucks.request.yaml b/postman/collections/Fleetbase Storefront API/Food Trucks/Query Food Trucks.request.yaml index 147cd12..7fcb5d0 100644 --- a/postman/collections/Fleetbase Storefront API/Food Trucks/Query Food Trucks.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Food Trucks/Query Food Trucks.request.yaml @@ -6,4 +6,14 @@ queryParams: limit: "" offset: "" sort: "" +scripts: + - type: afterResponse + code: |- + // Retrieve Food Truck addresses {{food_truck_id}}; nothing set it. + var json_response = pm.response.json(); + + if (Array.isArray(json_response) && json_response.length) { + pm.environment.set("food_truck_id", json_response[0].id); + } + language: text/javascript order: 1000