Skip to content

Commit

Permalink
Add the parameter type in the pasteData request
Browse files Browse the repository at this point in the history
  • Loading branch information
frouo committed Sep 1, 2022
1 parent d9c1556 commit e166159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/classes/google-spreadsheet-worksheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ Param|Type|Required|Description
`coordinate`|[[GridCoordinate](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#GridCoordinate)]|✅|The coordinate at which the data should start being inserted, sheetId not required!
`data`|String|✅|The data to insert.
`delimiter`|String|✅|The delimiter in the data.
`type`|String (enum)<br>[PasteType](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#PasteType)|-|How the data should be pasted. _defaults to `PASTE_NORMAL`_

#### `appendDimension(dimension, length)` (async) :id=fn-appendDimension
> Appends rows or columns to the end of a sheet.
Expand Down
3 changes: 2 additions & 1 deletion lib/GoogleSpreadsheetWorksheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ class GoogleSpreadsheetWorksheet {
// https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#UpdateEmbeddedObjectPositionRequest
}

async pasteData(coordinate, data, delimiter) {
async pasteData(coordinate, data, delimiter, type = "PASTE_NORMAL") {
// Request type = `pasteData`
// https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#PasteDataRequest
await this._makeSingleUpdateRequest("pasteData", {
Expand All @@ -708,6 +708,7 @@ class GoogleSpreadsheetWorksheet {
},
data,
delimiter,
type
});
}

Expand Down

0 comments on commit e166159

Please sign in to comment.