Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

refactor: convert swarm API to async/await #1172

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: post all the things
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Nov 21, 2019
commit 41863276ee9c10251e677401d7d19a8670bf363f
2 changes: 1 addition & 1 deletion src/swarm/addrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = configure(({ ky }) => {
return async options => {
options = options || {}

const res = await ky.get('swarm/addrs', {
const res = await ky.post('swarm/addrs', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
Expand Down
2 changes: 1 addition & 1 deletion src/swarm/localAddrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = configure(({ ky }) => {
const searchParams = new URLSearchParams(options.searchParams)
if (options.id != null) searchParams.append('id', options.id)

const res = await ky.get('swarm/addrs/local', {
const res = await ky.post('swarm/addrs/local', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
Expand Down
2 changes: 1 addition & 1 deletion src/swarm/peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = configure(({ ky }) => {
if (options.streams != null) searchParams.append('streams', options.streams)
if (options.verbose != null) searchParams.append('verbose', options.verbose)

const res = await ky.get('swarm/peers', {
const res = await ky.post('swarm/peers', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
Expand Down