File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import app from "../docugenerate.app.mjs" ;
2+
3+ export default {
4+ key : "docugenerate-delete-document" ,
5+ name : "Delete Document" ,
6+ description : "Deletes a specific document" ,
7+ version : "0.0.1" ,
8+ type : "action" ,
9+ props : {
10+ app,
11+ documentId : {
12+ type : "string" ,
13+ label : "Document" ,
14+ description : "The ID of the document" ,
15+ } ,
16+ } ,
17+ async run ( { $ } ) {
18+ const response = await this . app . deleteDocument ( $ , this . documentId ) ;
19+
20+ $ . export ( "$summary" , `Successfully deleted the document ${ this . documentId } ` ) ;
21+ return response ;
22+ } ,
23+ } ;
Original file line number Diff line number Diff line change @@ -80,5 +80,12 @@ export default {
8080 data : body ,
8181 } ) ;
8282 } ,
83+ async deleteDocument ( $ = this , documentId ) {
84+ return this . makeRequest ( {
85+ $,
86+ method : "DELETE" ,
87+ path : `/document/${ documentId } ` ,
88+ } ) ;
89+ } ,
8390 } ,
8491} ;
You can’t perform that action at this time.
0 commit comments