Skip to content

Commit

Permalink
fix first user creation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
matianfu committed Jul 10, 2017
1 parent 45754db commit 768dbd9
Show file tree
Hide file tree
Showing 7 changed files with 228 additions and 190 deletions.
2 changes: 1 addition & 1 deletion graph.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
madge --image graph.svg --exclude '^(common/async|fruitmix/models/models|fruitmix/lib/paths|fruitmix/middleware/auth)$' src/app.js
madge --image graph.svg --exclude '^(common/broadcast|fruitmix/models/models|fruitmix/lib/paths|fruitmix/middleware/auth)$' src/app.js
26 changes: 23 additions & 3 deletions src/fruitmix/lib/sidekick-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,24 @@ const debug = require('debug')('sidekick-client')
/**
This is the sidekick client.
@module sidekick-client
@module sidekickClient
*/

/**
This callback is displayed as part of the Requester class.
```
// http code -> error code
// 200 -> no error
// 400 -> EINVAL
// 409 -> EMISMATCH
// 500 -> no special error code
```
@callback uploadCallback
@param {object} err
@param {err.code} - translated http error code.
@param {object} body - res.body.
*/

/**
Expand All @@ -16,6 +33,11 @@ callback returns error or status code.
It provides `abort` method. When aborted, the callback receives an error with `EABORT` error code.
@param {object} query
@param {string} query.path - must be an absolute path
@param {number} query.size - expected size
@param {string} [query.sha256] - if provided, the sha256 will checked.
@param {number} [query.offset] - if provided, it is uploading a file chunk.
@param {module:sidekickClient~uploadCallback} callback - `(err, obj) => {}`
*/
const upload = (query, callback) => {

Expand Down Expand Up @@ -47,7 +69,6 @@ const upload = (query, callback) => {

if (finished) return
finished = true

callback(err)
})

Expand All @@ -60,7 +81,6 @@ const upload = (query, callback) => {

let err = new Error('aborted')
err.code = 'EABORT'

callback(err)
})

Expand Down
Loading

0 comments on commit 768dbd9

Please sign in to comment.