Comparing version 0.8.1 to 0.8.2
{ | ||
"name": "notabase", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "API Wrapper For Notion's Database", | ||
@@ -5,0 +5,0 @@ "main": "src/notabase.js", |
@@ -138,4 +138,6 @@ # Notabase (WIP) | ||
let newRow = collection.addRow() | ||
newRow.Tags = [tag1] | ||
// if tag1 is not exists, it will be auto created. | ||
newRow.Tags = ["tag1"] | ||
// create with value | ||
@@ -146,2 +148,9 @@ collection.addRow({title:"",Tags:["tag1"]}) | ||
#### Delete | ||
```js | ||
// delete row | ||
aSong.delete() | ||
``` | ||
#### Update Table Schema | ||
@@ -167,2 +176,2 @@ ```js | ||
### row | ||
+ [ ] row.delete() // delete a row | ||
+ [x] row.delete() // delete a row |
@@ -351,2 +351,21 @@ const utils = require('./utils') | ||
} | ||
} else if (property === "delete") { | ||
let del = () => { | ||
let postData = { | ||
"operations": [ | ||
{ | ||
"id": target.id, "table": "block", "path": [], "command": "update", "args": { | ||
parent_id: this.collectionId, | ||
parent_table: "collection", | ||
alive: false | ||
} | ||
}, | ||
{ | ||
"id": target.id, "table": "block", "path": ["last_edited_time"], "command": "set", "args": (new Date()).getTime() | ||
} | ||
] | ||
} | ||
this.client.reqeust.post('/api/v3/submitTransaction', postData) | ||
} | ||
return del | ||
} else { | ||
@@ -353,0 +372,0 @@ return undefined |
39709
798
175