File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-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-update-document" ,
5+ name : "Update Document" ,
6+ description : "Updates a specific document" ,
7+ version : "0.0.2" ,
8+ type : "action" ,
9+ props : {
10+ app,
11+ documentId : {
12+ type : "string" ,
13+ label : "Document" ,
14+ description : "The ID of the document" ,
15+ } ,
16+ name : {
17+ type : "string" ,
18+ label : "Name" ,
19+ description : "The new name for the document" ,
20+ } ,
21+ } ,
22+ async run ( { $ } ) {
23+ const response = await this . app . updateDocument ( $ , this . documentId , {
24+ name : this . name
25+ } ) ;
26+
27+ $ . export ( "$summary" , `Successfully updated the document ${ this . documentId } ` ) ;
28+ return response ;
29+ } ,
30+ } ;
Original file line number Diff line number Diff line change @@ -72,5 +72,13 @@ export default {
7272 path : `/document/${ documentId } ` ,
7373 } ) ;
7474 } ,
75+ async updateDocument ( $ = this , documentId , body ) {
76+ return this . makeRequest ( {
77+ $,
78+ method : "PUT" ,
79+ path : `/document/${ documentId } ` ,
80+ data : body ,
81+ } ) ;
82+ } ,
7583 } ,
7684} ;
You can’t perform that action at this time.
0 commit comments