File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { IlistItemCommentsResults } from "./../models";
55import { IAddCommentPayload } from "../models/IAddCommentPayload" ;
66import { IComment } from "../components/Comments/IComment" ;
77import { PageContext } from "@microsoft/sp-page-context" ;
8+ import { GeneralHelper } from '../../../common/utilities/GeneralHelper' ;
89interface returnObject {
910 getListItemComments : ( ) => Promise < IlistItemCommentsResults > ;
1011 getNextPageOfComments : (
@@ -53,9 +54,10 @@ export const useSpAPI = (): returnObject => {
5354 webUrl ?? _webUrl
5455 } /_api/web/lists(@a1)/GetItemById(@a2)/Comments()?@a1='${ listId } '&@a2='${ itemId } '`;
5556 const spOpts : ISPHttpClientOptions = {
56- body : `{ "text": "${ comment . text } ", "mentions": ${ JSON . stringify (
57- comment . mentions
58- ) } }`,
57+ body : JSON . stringify ( {
58+ text : GeneralHelper . encodeText ( comment . text ) ,
59+ mentions : comment . mentions
60+ } ) ,
5961 } ;
6062 const _listResults : SPHttpClientResponse = await spHttpClient . post (
6163 `${ _endPointUrl } ` ,
You can’t perform that action at this time.
0 commit comments