Skip to content

Commit

Permalink
Merge pull request #11 from Speckle-Next/dim/gql-integration
Browse files Browse the repository at this point in the history
Dim/gql integration
  • Loading branch information
didimitrie authored Jul 25, 2020
2 parents ea38bd1 + 3a3d1a2 commit d7e3df9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions modules/core/rest/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ module.exports = ( app ) => {

busboy.on( 'finish', ( ) => {
debug( 'speckle:upload-endpoint' )( 'Done parsing ' + totalProcessed + ' objs ' + process.memoryUsage( ).heapUsed / 1024 / 1024 + ' mb mem' )
res.writeHead( 303, { Connection: 'close', Location: '/' } )
res.end( )

res.status( 201 ).end( )
} )

req.pipe( busboy )
} )
}
}
6 changes: 3 additions & 3 deletions modules/core/tests/rest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ describe( `Upload/Download Routes`, ( ) => {
.attach( 'batch2', Buffer.from( JSON.stringify( objBatches[ 1 ] ), 'utf8' ) )
.attach( 'batch3', Buffer.from( JSON.stringify( objBatches[ 2 ] ), 'utf8' ) )

expect( res ).to.have.status( 303 )
expect( res ).to.have.status( 201 )
} )

it( 'Should properly download an object, with all its children, into a application/json response', ( done ) => {
new Promise( resolve => setTimeout( resolve, 1000 ) ) // avoids race condition
new Promise( resolve => setTimeout( resolve, 1500 ) ) // avoids race condition
.then( ( ) => {
let res = request( expressApp )
.get( `/objects/${testStream.id}/${parentId}` )
Expand Down Expand Up @@ -177,4 +177,4 @@ function createManyObjects( amount, noise ) {

function getId( obj ) {
obj.id = obj.id || crypto.createHash( 'md5' ).update( JSON.stringify( obj ) ).digest( 'hex' )
}
}

0 comments on commit d7e3df9

Please sign in to comment.