File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,10 +90,10 @@ function callAppsScript(auth) {
9090 resource : {
9191 title : 'My Script' ,
9292 } ,
93- } , ( err , { data } ) => {
93+ } , ( err , res ) => {
9494 if ( err ) return console . log ( `The API create method returned an error: ${ err } ` ) ;
9595 script . projects . updateContent ( {
96- scriptId : data . scriptId ,
96+ scriptId : res . data . scriptId ,
9797 auth,
9898 resource : {
9999 files : [ {
@@ -107,9 +107,9 @@ function callAppsScript(auth) {
107107 '\"CLOUD\"}' ,
108108 } ] ,
109109 } ,
110- } , { } , ( err , { data } ) => {
110+ } , { } , ( err , res ) => {
111111 if ( err ) return console . log ( `The API updateContent method returned an error: ${ err } ` ) ;
112- console . log ( `https://script.google.com/d/${ data . scriptId } /edit` ) ;
112+ console . log ( `https://script.google.com/d/${ res . data . scriptId } /edit` ) ;
113113 } ) ;
114114 } ) ;
115115}
Original file line number Diff line number Diff line change @@ -99,9 +99,9 @@ function listEvents(auth) {
9999 maxResults : 10 ,
100100 singleEvents : true ,
101101 orderBy : 'startTime' ,
102- } , ( err , { data } ) => {
102+ } , ( err , res ) => {
103103 if ( err ) return console . log ( 'The API returned an error: ' + err ) ;
104- const events = data . items ;
104+ const events = res . data . items ;
105105 if ( events . length ) {
106106 console . log ( 'Upcoming 10 events:' ) ;
107107 events . map ( ( event , i ) => {
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ function listCourses(auth) {
8989 const classroom = google . classroom ( { version : 'v1' , auth} ) ;
9090 classroom . courses . list ( {
9191 pageSize : 10 ,
92- } , ( err , { data } ) => {
92+ } , ( err , res ) => {
9393 if ( err ) return console . error ( 'The API returned an error: ' + err ) ;
94- const courses = data . courses ;
94+ const courses = res . data . courses ;
9595 if ( courses && courses . length ) {
9696 console . log ( 'Courses:' ) ;
9797 courses . forEach ( ( course ) => {
Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ function listActivity(auth) {
9292 'source' : 'drive.google.com' ,
9393 'drive.ancestorId' : 'root' ,
9494 'pageSize' : 10 ,
95- } , ( err , { data } ) => {
95+ } , ( err , res ) => {
9696 if ( err ) return console . error ( 'The API returned an error: ' + err ) ;
97- const activities = data . activities ;
97+ const activities = res . data . activities ;
9898 if ( activities ) {
9999 console . log ( 'Recent activity:' ) ;
100100 activities . forEach ( ( activity ) => {
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ function listFiles(auth) {
8989 drive . files . list ( {
9090 pageSize : 10 ,
9191 fields : 'nextPageToken, files(id, name)' ,
92- } , ( err , { data } ) => {
92+ } , ( err , res ) => {
9393 if ( err ) return console . log ( 'The API returned an error: ' + err ) ;
94- const files = data . files ;
94+ const files = res . data . files ;
9595 if ( files . length ) {
9696 console . log ( 'Files:' ) ;
9797 files . map ( ( file ) => {
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ function listLabels(auth) {
8989 const gmail = google . gmail ( { version : 'v1' , auth} ) ;
9090 gmail . users . labels . list ( {
9191 userId : 'me' ,
92- } , ( err , { data } ) => {
92+ } , ( err , res ) => {
9393 if ( err ) return console . log ( 'The API returned an error: ' + err ) ;
94- const labels = data . labels ;
94+ const labels = res . data . labels ;
9595 if ( labels . length ) {
9696 console . log ( 'Labels:' ) ;
9797 labels . forEach ( ( label ) => {
Original file line number Diff line number Diff line change @@ -90,9 +90,9 @@ function listMajors(auth) {
9090 sheets . spreadsheets . values . get ( {
9191 spreadsheetId : '1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms' ,
9292 range : 'Class Data!A2:E' ,
93- } , ( err , { data } ) => {
93+ } , ( err , res ) => {
9494 if ( err ) return console . log ( 'The API returned an error: ' + err ) ;
95- const rows = data . values ;
95+ const rows = res . data . values ;
9696 if ( rows . length ) {
9797 console . log ( 'Name, Major:' ) ;
9898 // Print columns A and E, which correspond to indices 0 and 4.
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ function listSlides(auth) {
8989 const slides = google . slides ( { version : 'v1' , auth} ) ;
9090 slides . presentations . get ( {
9191 presentationId : '1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc' ,
92- } , ( err , { data } ) => {
92+ } , ( err , res ) => {
9393 if ( err ) return console . log ( 'The API returned an error: ' + err ) ;
94- const length = data . slides . length ;
94+ const length = res . data . slides . length ;
9595 console . log ( 'The presentation contains %s slides:' , length ) ;
9696 data . slides . map ( ( slide , i ) => {
9797 console . log ( `- Slide #${ i + 1 } contains ${ slide . pageElements . length } elements.` ) ;
Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ function listTaskLists(auth) {
8989 const service = google . tasks ( { version : 'v1' , auth} ) ;
9090 service . tasklists . list ( {
9191 maxResults : 10 ,
92- } , ( err , { data } ) => {
92+ } , ( err , res ) => {
9393 if ( err ) return console . error ( 'The API returned an error: ' + err ) ;
94- const taskLists = data . items ;
94+ const taskLists = res . data . items ;
9595 if ( taskLists ) {
9696 console . log ( 'Task lists:' ) ;
9797 taskLists . forEach ( ( taskList ) => {
You can’t perform that action at this time.
0 commit comments