@@ -9,7 +9,7 @@ class GraphVertexCollection extends BaseCollection {
99 super ( connection , name ) ;
1010 this . type = types . DOCUMENT_COLLECTION ;
1111 this . graph = graph ;
12- this . _gharial = this . _api . route ( `gharial/${ this . graph . name } /vertex/ ${ this . name } ` ) ;
12+ this . _gharial = this . _api . route ( `gharial/${ this . graph . name } /vertex` ) ;
1313 }
1414
1515 _documentPath ( documentHandle ) {
@@ -19,7 +19,7 @@ class GraphVertexCollection extends BaseCollection {
1919 remove ( documentHandle , cb ) {
2020 const { promise, callback} = this . _connection . promisify ( cb ) ;
2121 this . _gharial . delete (
22- documentHandle ,
22+ this . _documentHandle ( documentHandle ) ,
2323 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
2424 ) ;
2525 return promise ;
@@ -28,7 +28,7 @@ class GraphVertexCollection extends BaseCollection {
2828 vertex ( documentHandle , cb ) {
2929 const { promise, callback} = this . _connection . promisify ( cb ) ;
3030 this . _gharial . get (
31- documentHandle ,
31+ this . _documentHandle ( documentHandle ) ,
3232 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
3333 ) ;
3434 return promise ;
@@ -37,8 +37,8 @@ class GraphVertexCollection extends BaseCollection {
3737 save ( data , cb ) {
3838 const { promise, callback} = this . _connection . promisify ( cb ) ;
3939 this . _gharial . post (
40+ this . name ,
4041 data ,
41- { collection : this . name } ,
4242 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
4343 ) ;
4444 return promise ;
@@ -50,13 +50,13 @@ class GraphEdgeCollection extends EdgeCollection {
5050 super ( connection , name ) ;
5151 this . type = types . EDGE_COLLECTION ;
5252 this . graph = graph ;
53- this . _gharial = this . _api . route ( `gharial/${ this . graph . name } /edge/ ${ this . name } ` ) ;
53+ this . _gharial = this . _api . route ( `gharial/${ this . graph . name } /edge` ) ;
5454 }
5555
5656 remove ( documentHandle , cb ) {
5757 const { promise, callback} = this . _connection . promisify ( cb ) ;
5858 this . _gharial . delete (
59- documentHandle ,
59+ this . _documentHandle ( documentHandle ) ,
6060 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
6161 ) ;
6262 return promise ;
@@ -65,7 +65,7 @@ class GraphEdgeCollection extends EdgeCollection {
6565 edge ( documentHandle , cb ) {
6666 const { promise, callback} = this . _connection . promisify ( cb ) ;
6767 this . _gharial . get (
68- documentHandle ,
68+ this . _documentHandle ( documentHandle ) ,
6969 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
7070 ) ;
7171 return promise ;
@@ -81,6 +81,7 @@ class GraphEdgeCollection extends EdgeCollection {
8181 }
8282 const { promise, callback} = this . _connection . promisify ( cb ) ;
8383 this . _gharial . post (
84+ this . name ,
8485 data ,
8586 ( err , res ) => err ? callback ( err ) : callback ( null , res . body )
8687 ) ;
0 commit comments