Repository navigation
List & Map Parameter in Endpoints - #194
anandsubbu007 wants to merge 9 commits into
Conversation
| } | ||
|
|
||
| /// For most cases use the corresponding method in [Database] instead. | ||
| /// If [id] in [TableRow] Already Exist then that row will be replaced by new value |
There was a problem hiding this comment.
Added Function to batch insert or update of the list of a Table row.
but if the list of table rows with and without IDs is passed it will not work.
| var serverDir = Directory(p.join(projectDir.path, name + '_server')); | ||
| if (verbose) print('Creating directory: ${serverDir.path}'); | ||
| serverDir.createSync(); | ||
| await serverDir.create(recursive: true); |
There was a problem hiding this comment.
on dev branch serverpod create mypod not working
| } | ||
|
|
||
| Future<List<String>> testListOfString( | ||
| List<String> value, |
There was a problem hiding this comment.
Added Test case for testing purpose
| var listData = (jsonDecode(input) as List?); | ||
| var dds = listData | ||
| ?.map((e) => _formatArg(e, e.runtimeType, serializationManager)) | ||
| .toList(); |
There was a problem hiding this comment.
Modified code to read List and map Parameter
| return data; | ||
| } | ||
| } catch (error) { | ||
| // print('Error in Format Args: $error'); |
There was a problem hiding this comment.
Need to throw an error to the user about the error is creating entity Serialization
| return e == null | ||
| ? null | ||
| : serializationManager | ||
| .createEntityFromSerialization(e is Map ? e : jsonDecode(e)); |
There was a problem hiding this comment.
Need to find better way to avoid unnecessary jsondecode usage in this line.
because json decoder is used twice
| /// This will helpful when you want to get additional info with filter like to get total items | ||
| /// available when you do pagination | ||
| extension SerializableEntityListExtension on List<SerializableEntity> { | ||
| set resStatusCode(int statusCode) { |
There was a problem hiding this comment.
just added this to get additional details along with a list of classes.
useful is client need to know additional details with data like
in pagination total items availability, error info
|
broke this pr into separate parts based on function and add in the following pr: #196 |
Added List and map parameter Support