stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

channel deleteReaction is not working

Open anthonyroan opened this issue 1 year ago • 0 comments

channel.deleteReaction(message_id, { type: 'love', }).then(result => { if (BF.community_current_topic && BF.community_current_topic.channel == channel_type) { viewEventTopic(BF.community_current_topic.id, BF.community_current_topic.channel, window.scrollY) } else { BF.getChannelMessages(displayMainMessages) } }, error => { console.log(error); }); } else { BF[channel_name].sendReaction(message_id, { type: 'love', }).then(result => { if (BF.community_current_topic && BF.community_current_topic.channel == channel_type) { viewEventTopic(BF.community_current_topic.id, BF.community_current_topic.channel, window.scrollY) } else { BF.getChannelMessages(displayMainMessages) } }, error => { console.log(error); });

Although sendReaction is working properly, deleteReaction is not working due to 400 error.

{ "response": { "data": "NativeXHR: Invalid url scheme '(null)'; only http and https are supported by NativeXHR", "status": 400, "statusText": "Bad Request", "headers": {}, "config": { "url": "https://chat-us-east-1.stream-io-api.com/messages/8e57104b-0f9a-468a-9693-bd49f7ecee3c/reaction/[object Object]", "method": "delete", "headers": { "Accept": "application/json, text/plain, */*", "Authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMTUxNDc4NSJ9.Qt0f4QGU6E2IMbb2d5F8jFZdwnhKX-0biArOD1_Zk5Q", "stream-auth-type": "jwt", "x-stream-client": "stream-chat-javascript-client-browser-2.6.0" }, "params": { "user_id": "1514785", "api_key": "6uqphnyems7b", "connection_id": "64b81419-0a05-16b1-0000-000000bdb88f" }, "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 3000, "withCredentials": false, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "warmUp": false }, "request": { "_context": { "delegate": null, "requestHeaders": { "accept": "application/json, text/plain, */*", "authorization": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMTUxNDc4NSJ9.Qt0f4QGU6E2IMbb2d5F8jFZdwnhKX-0biArOD1_Zk5Q", "stream-auth-type": "jwt", "x-stream-client": "stream-chat-javascript-client-browser-2.6.0" }, "responseHeaders": {}, "listeners": {}, "readyState": 4, "responseType": "text", "withCredentials": false, "upload": { "_context": { "listeners": {} } }, "status": 400, "method": "DELETE", "url": "https://chat-us-east-1.stream-io-api.com/messages/8e57104b-0f9a-468a-9693-bd49f7ecee3c/reaction/[object Object]?user_id=1514785&api_key=6uqphnyems7b&connection_id=64b81419-0a05-16b1-0000-000000bdb88f", "async": true, "timeout": 3000, "statusText": "Bad Request", "responseText": "NativeXHR: Invalid url scheme '(null)'; only http and https are supported by NativeXHR" } } }, "status": 400 }

anthonyroan avatar Jul 26 '23 19:07 anthonyroan