This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 26
26
- [ POST|PUT /db/: dbname /put] ( #post-put-dbdbnameput )
27
27
- [ POST|PUT /db/: dbname /inc] ( #post-put-dbdbnameinc )
28
28
- [ POST|PUT /db/: dbname /inc/: val ] ( #post-put-dbdbnameincval )
29
+ - [ POST|PUT /db/: dbname /access/write] ( #post-put-dbdbnameaccesswrite )
29
30
- [ DELETE /db/: dbname ] ( #delete-dbdbname )
30
31
- [ DELETE /db/: dbname /: item ] ( #delete-dbdbnameitem )
31
32
- [ Contribute] ( #contribute )
@@ -400,6 +401,18 @@ curl -X POST http://localhost:3000/db/counter/inc/100
400
401
zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
401
402
```
402
403
404
+ ### POST|PUT /db/: dbname /access/write
405
+
406
+ Adds the id to the list of peers who have write access to the : dbname data store.
407
+
408
+ ``` shell
409
+ curl -X POST http://localhost:3000/db/docstore/access/write -d ' id=045757bffcc7a4...'
410
+ ```
411
+
412
+ ``` json
413
+ zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
414
+ ```
415
+
403
416
### DELETE /db/: dbname
404
417
405
418
Deletes the local database : dbname . This does not delete any data from peers.
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ class OrbitdbAPI {
263
263
method : [ 'POST' , 'PUT' ] ,
264
264
path : '/db/{dbname}/access/write' ,
265
265
handler : dbMiddleware ( async ( db , request , _h ) => {
266
- await db . access . grant ( 'write' , request . payload . publicKey )
266
+ await db . access . grant ( 'write' , request . payload . id )
267
267
return { } ;
268
268
} )
269
269
} ,
You can’t perform that action at this time.
0 commit comments