Skip to content

Commit

Permalink
Merge pull request #303 from eve-bright/fix-frame-termination-for-rest
Browse files Browse the repository at this point in the history
Change rollback method in CypherTransactionRest to use delete directly instead of transaction in Server.
  • Loading branch information
pe4cey authored Oct 31, 2016
2 parents 8b71774 + 6666806 commit 47a1620
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions app/scripts/services/CypherTransactionREST.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ angular.module('neo4jApp.services')
'UsageDataCollectionService'
'Timer'
'Parameters'
($q, CypherResult, Server, UDC, Timer, Parameters) ->
'Settings'
($q, CypherResult, Server, UDC, Timer, Parameters, Settings) ->
parseId = (resource = "") ->
id = resource.split('/').slice(-2, -1)
return parseInt(id, 10)
Expand Down Expand Up @@ -158,11 +159,7 @@ angular.module('neo4jApp.services')
if not @id
q.resolve({})
return q.promise
server_promise = Server.transaction(
method: 'DELETE'
path: '/' + @id
statements: []
)
server_promise = Server.delete(Settings.endpoint.transaction + '/' + @id)
server_promise.then(
(r) =>
@_reset()
Expand Down
8 changes: 3 additions & 5 deletions app/scripts/services/Server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ angular.module('neo4jApp.services')
path = host + path unless path.indexOf(host) is 0
$http.head(path, options or httpOptions)

delete: (path = '', data = null, host = Settings.host) ->
delete: (path = '', host = Settings.host) ->
path = host + path unless path.indexOf(host) is 0
$http.delete(path, httpOptions)

Expand All @@ -85,16 +85,14 @@ angular.module('neo4jApp.services')
opts = angular.extend(
path: '',
statements: [],
method: 'post',
host: Settings.host
, opts)
{path, statements, method, host} = opts
{path, statements, host} = opts
path = Settings.endpoint.transaction + path
method = method.toLowerCase()
for s in statements
s.resultDataContents = ['row','graph']
s.includeStats = true
@[method]?(path, {statements: statements}, {addAuthHeader: opts.addAuthHeader}, host)
@post(path, {statements: statements}, {addAuthHeader: opts.addAuthHeader}, host)

#
# Convenience methods
Expand Down

0 comments on commit 47a1620

Please sign in to comment.