[APIv2/Librus] Fix attendance metadata

This commit is contained in:
Kacper Ziubryniewicz 2019-10-13 16:34:44 +02:00
parent 42b56fa4a2
commit 70d35e12e5

View File

@ -66,6 +66,7 @@ class LibrusApiAttendances(override val data: DataLibrus,
val addedDate = Date.fromIso(attendance.getString("AddDate") ?: return@forEach) val addedDate = Date.fromIso(attendance.getString("AddDate") ?: return@forEach)
data.attendanceList.add(attendanceObject) data.attendanceList.add(attendanceObject)
if(type != Attendance.TYPE_PRESENT) {
data.metadataList.add(Metadata( data.metadataList.add(Metadata(
profileId, profileId,
Metadata.TYPE_ATTENDANCE, Metadata.TYPE_ATTENDANCE,
@ -75,6 +76,7 @@ class LibrusApiAttendances(override val data: DataLibrus,
addedDate addedDate
)) ))
} }
}
data.setSyncNext(ENDPOINT_LIBRUS_API_ATTENDANCES, SYNC_ALWAYS) data.setSyncNext(ENDPOINT_LIBRUS_API_ATTENDANCES, SYNC_ALWAYS)
onSuccess() onSuccess()