Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 7c01239

Browse files
committed
Merge branch 'feat/identity_id' into develop
2 parents fa4c4d3 + 3fce8f1 commit 7c01239

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
- [POST|PUT /db/:dbname/put](#post-put-dbdbnameput)
2727
- [POST|PUT /db/:dbname/inc](#post-put-dbdbnameinc)
2828
- [POST|PUT /db/:dbname/inc/:val](#post-put-dbdbnameincval)
29+
- [POST|PUT /db/:dbname/access/write](#post-put-dbdbnameaccesswrite)
2930
- [DELETE /db/:dbname](#delete-dbdbname)
3031
- [DELETE /db/:dbname/:item](#delete-dbdbnameitem)
3132
- [Contribute](#contribute)
@@ -400,6 +401,18 @@ curl -X POST http://localhost:3000/db/counter/inc/100
400401
zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
401402
```
402403

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+
403416
### DELETE /db/:dbname
404417

405418
Deletes the local database :dbname. This does not delete any data from peers.

src/lib/orbitdb-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class OrbitdbAPI {
263263
method: ['POST', 'PUT'],
264264
path: '/db/{dbname}/access/write',
265265
handler: dbMiddleware( async (db, request, _h) => {
266-
await db.access.grant('write', request.payload.publicKey)
266+
await db.access.grant('write', request.payload.id)
267267
return {};
268268
})
269269
},

0 commit comments

Comments
 (0)