Skip to content

Commit

Permalink
Flip the order of the example
Browse files Browse the repository at this point in the history
  • Loading branch information
symphony-jean-michael committed Sep 1, 2022
1 parent f2c89da commit 1d7f05b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions docs/context/ref/ChatRoom.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,24 @@ The `uri` is an universal url to access to the room. It could be opened from a b
## Example

```js
const chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};

//Chat rooms are returned by the StartChat intent as a result
const intentResolution = await fdc3.raiseIntent("StartChat", context);

const chatRoom = intentResolution.getResult():

/* // The chatRoom will be like:
chatRoom = {
type: "fdc3.chat.room",
providerName: "Symphony",
id: {
roomId: "j75xqXy25NBOdacUI3FNBH"
}
uri: "http://symphony.com/ref/room/j75xqXy25NBOdacUI3FNBH___pqSsuJRdA",
name: 'My new room'
};
*/
try {
const chatRoom = await intentResolution.getResult():
} catch (error) {
//chat room was not created...
}
```

## See Also
Expand Down

0 comments on commit 1d7f05b

Please sign in to comment.