Skip to content
Snippets Groups Projects
Commit 2c27e2e5 authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

All action return a dictionary containing the ROOT key with the id of the...

All action return a dictionary containing the ROOT key with the id of the modified/update/delete row.
parent 4d17bd11
No related branches found
No related tags found
No related merge requests found
...@@ -212,7 +212,7 @@ class DbSvc(BaseSvc): ...@@ -212,7 +212,7 @@ class DbSvc(BaseSvc):
as well as the identifier of the record to be updated (id) as well as the identifier of the record to be updated (id)
Return a dictionary with status, message and id of the update row: Return a dictionary with status, message and id of the update row:
{success: True, msg: 'blalbla', data:{TableId:xx}} {success: True, msg: 'blalbla', records:{TableId:xx}}
""" """
self.dbg("Start DbSvc.create") self.dbg("Start DbSvc.create")
...@@ -230,7 +230,8 @@ class DbSvc(BaseSvc): ...@@ -230,7 +230,8 @@ class DbSvc(BaseSvc):
self.dbg("End DbSvc.create.", RECORD_INSERTED % id) self.dbg("End DbSvc.create.", RECORD_INSERTED % id)
# NOTE Ext JS 3.3.2 request explicitly the word 'data' # NOTE Ext JS 3.3.2 request explicitly the word 'data'
# if you use records (ROOT) javascript raise an exception !!! # if you use records (ROOT) javascript raise an exception !!!
return {SUCCESS: True, 'msg': RECORD_INSERTED % id, 'data': {table_id: id}} # Depends....
return {SUCCESS: True, 'msg': RECORD_INSERTED % id, ROOT: {table_id: id}}
def destroy(self, arg): def destroy(self, arg):
...@@ -248,8 +249,8 @@ class DbSvc(BaseSvc): ...@@ -248,8 +249,8 @@ class DbSvc(BaseSvc):
records (ROOT) records (ROOT)
A list with id numbers A list with id numbers
Return a dictionary with status and error message: Return a dictionary with status, message and id of the deleted row:
{success: True, msg: 'blalbla'} {success: True, msg: 'blalbla', records:{TableId:xx}}
""" """
self.dbg("Start DbSvc.destroy") self.dbg("Start DbSvc.destroy")
...@@ -261,7 +262,9 @@ class DbSvc(BaseSvc): ...@@ -261,7 +262,9 @@ class DbSvc(BaseSvc):
del self.environment['db'][table][id] del self.environment['db'][table][id]
self.dbg("End DbSvc.destroy") self.dbg("End DbSvc.destroy")
return {"success": True, "msg": RECORD_DELETED % id}
table_id = encode_field(table, 'id')
return {"success": True, "msg": RECORD_DELETED % id, ROOT: {table_id: id}}
def read(self, arg): def read(self, arg):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment