Future update(id, data, [Map params])

Overwrites a resource.

Source

Future update(id, data, [Map params]) async {
  int desiredId = int.parse(id.toString());
  if (items.containsKey(desiredId)) {
    try {
      items[desiredId] =
      (data is Map) ? god.deserializeDatum(data, outputType: T) : data;
      return _makeJson(desiredId, items[desiredId]);
    } catch (e) {
      throw new AngelHttpException.BadRequest(message: 'Invalid data.');
    }
  } else throw new AngelHttpException.NotFound();
}