addSession method

Future<int> addSession(
  1. Session s
)

Implementation

Future<int> addSession(Session s) async {
  final Either<String, Map<String, dynamic>> res = await mappingPostRequest(
    "/sessions",
    <String, dynamic>{
      "supervisor": s.supervisor,
      "school": s.school,
      "section": s.section,
      "date": s.date.toIso8601String(),
      "notes": s.notes,
      "language": s.language,
      "schoolGrade": s.schoolGrade,
    },
  ).run();

  return res.getOrElse((String l) => <String, dynamic>{})["id"];
}