diff --git a/postman/collections/Fleetbase Core API/Chat Channels/List Available Participants.request.yaml b/postman/collections/Fleetbase Core API/Chat Channels/List Available Participants.request.yaml index 9296f2b..239252b 100644 --- a/postman/collections/Fleetbase Core API/Chat Channels/List Available Participants.request.yaml +++ b/postman/collections/Fleetbase Core API/Chat Channels/List Available Participants.request.yaml @@ -5,4 +5,18 @@ url: "{{base_url}}/{{namespace}}/chat-channels/available-participants" method: GET queryParams: channel: "{{chat_channel_id}}" +scripts: + - type: afterResponse + code: | + // Send Message, Add Participant and Create Read Receipt all address a user + // by {{user_id}}, which nothing set — they failed with "Sender of chat + // message not found" and "User to add as participant not found". This + // endpoint already returns the users eligible to participate, so take the + // first one rather than seeding a second fixture. + var json_response = pm.response.json(); + let cv = pm.environment; + if (Array.isArray(json_response) && json_response.length) { + cv.set("user_id", json_response[0].id); + } + language: text/javascript order: 1000 diff --git a/postman/collections/Fleetbase Core API/Comments/Create Comment.request.yaml b/postman/collections/Fleetbase Core API/Comments/Create Comment.request.yaml index 1b03aba..a243c3e 100644 --- a/postman/collections/Fleetbase Core API/Comments/Create Comment.request.yaml +++ b/postman/collections/Fleetbase Core API/Comments/Create Comment.request.yaml @@ -9,8 +9,8 @@ body: { "content": "Example comment", "subject": { - "id": "{{organization_id}}", - "type": "company" + "id": "{{file_id}}", + "type": "file" } }