fix: Improve delete operations with existence checks
- Update delete functions to return bool indicating success - Add existence checks before deleting items - Return 404 error for non-existent items in RPC delete operations - Remove unused 'new_response_ok' result from RPC delete operations
This commit is contained in:
@@ -51,7 +51,7 @@ pub fn new_response_true(id int) Response {
|
||||
pub fn new_response_ok(id int) Response {
|
||||
return Response{
|
||||
jsonrpc: jsonrpc_version
|
||||
result: ''
|
||||
result: 'true'
|
||||
id: id
|
||||
}
|
||||
}
|
||||
@@ -96,9 +96,6 @@ pub fn new_error_response(id int, error RPCError) Response {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// decode_response parses a JSON string into a Response object.
|
||||
// This function handles the complex validation rules for JSON-RPC responses.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user