Created
March 30, 2020 20:23
-
-
Save jamigibbs/11324b5c192462c40e074745a024c823 to your computer and use it in GitHub Desktop.
lwc output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this._socket.on('output', (data) => { | |
| if (data) { | |
| const fields = {}; | |
| fields[CONTENT_FIELD.fieldApiName] = data.message; | |
| fields[USER_FIELD.fieldApiName] = this.userId; | |
| const message = { apiName: MESSAGE_OBJECT.objectApiName, fields }; | |
| createRecord(message) | |
| .then(() => { | |
| this._socket.emit('transmit'); | |
| return refreshApex(this.wiredMessages); | |
| }) | |
| .catch(error => { | |
| // eslint-disable-next-line no-console | |
| console.error('error', error); | |
| this.error = 'Error creating message'; | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment