This repository was archived by the owner on Apr 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -152,5 +152,11 @@ export const APIConfig = {
152152 path : "/../comments/:id" ,
153153 method : "patch" ,
154154 } ,
155+
156+ /** Update a comment **/
157+ deleteComment : {
158+ path : "/../comments/:id" ,
159+ method : "delete" ,
160+ } ,
155161 } ,
156162} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ export class CommentsSdk {
1111 [
1212 'comments:create' ,
1313 'comments:update' ,
14+ 'comments:delete' ,
1415 'comments:list' ,
1516 ] . forEach ( ( evt ) => this . lsf . off ( evt ) ) ;
1617
1718 this . lsf . on ( "comments:create" , this . createComment ) ;
1819 this . lsf . on ( "comments:update" , this . updateComment ) ;
20+ this . lsf . on ( "comments:delete" , this . deleteComment ) ;
1921 this . lsf . on ( "comments:list" , this . listComments ) ;
2022 }
2123
@@ -73,5 +75,13 @@ export class CommentsSdk {
7375
7476 return comments ;
7577 }
78+
79+ deleteComment = async ( comment ) => {
80+ if ( ! comment . id || comment . id < 0 ) return ; // Don't allow an update with an incorrect id
81+
82+ const res = await this . dm . apiCall ( "deleteComment" , { id : comment . id } , { body : comment } ) ;
83+
84+ return res ;
85+ }
7686}
7787
You can’t perform that action at this time.
0 commit comments