mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Rest service return ResourceId after the creation.
This commit is contained in:
parent
70b8fe8727
commit
e4dc4a50aa
@ -183,9 +183,10 @@ public class MindmapController extends BaseController {
|
|||||||
// Add new mindmap ...
|
// Add new mindmap ...
|
||||||
mindmapService.addMindmap(delegated, user);
|
mindmapService.addMindmap(delegated, user);
|
||||||
|
|
||||||
|
|
||||||
// Return the new created map ...
|
// Return the new created map ...
|
||||||
response.setHeader("Location", "/service/maps/" + delegated.getId());
|
response.setHeader("Location", "/service/maps/" + delegated.getId());
|
||||||
|
response.setHeader("ResourceId", Integer.toString(delegated.getId()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"})
|
@RequestMapping(method = RequestMethod.POST, value = "/maps/{id}", consumes = {"application/xml", "application/json"})
|
||||||
|
@ -177,8 +177,7 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
contentType:"application/json; charset=utf-8",
|
contentType:"application/json; charset=utf-8",
|
||||||
success : function(data, textStatus, jqXHR) {
|
success : function(data, textStatus, jqXHR) {
|
||||||
var location = jqXHR.getResponseHeader("Location");
|
var mapId = jqXHR.getResponseHeader("ResourceId");
|
||||||
var mapId = location.substring(location.lastIndexOf('/') + 1, location.length);
|
|
||||||
window.location = "c/editor.htm?action=open&mapId=" + mapId;
|
window.location = "c/editor.htm?action=open&mapId=" + mapId;
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user