saveRemote<T extends VasatModel<T>> method

Future<String> saveRemote<T extends VasatModel<T>>(
  1. T entity
)

////////////////////////////////////// CRUD ////////////////////////////////////////////////////

Implementation

Future<String> saveRemote<T extends VasatModel<T>>(T entity) async {

  return apiPost(getUrlPath<T>(entity), entity.toJsonItem())
      .then((res) => (res is Map && res.containsKey("message")) ? res["message"].toString() : res.toString() );

}