|
|
|
|
@ -8,8 +8,7 @@ import com.parse.ParseException
|
|
|
|
|
import com.parse.ParseObject
|
|
|
|
|
import com.parse.ParseQuery
|
|
|
|
|
|
|
|
|
|
object ParseController {
|
|
|
|
|
|
|
|
|
|
internal object ParseController {
|
|
|
|
|
private inline fun <reified T : ParseObject>getQuery(
|
|
|
|
|
allowCache: Boolean = true
|
|
|
|
|
): ParseQuery<T> {
|
|
|
|
|
@ -23,7 +22,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchAdminStatus(
|
|
|
|
|
fun fetchAdminStatus(
|
|
|
|
|
name: String?,
|
|
|
|
|
action: (objectId: String?, admin: Boolean?, e: ParseException?) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
@ -41,7 +40,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchYears(action: (entries: List<Year>, e: ParseException?) -> Unit) {
|
|
|
|
|
fun fetchYears(action: (entries: List<Year>, e: ParseException?) -> Unit) {
|
|
|
|
|
val query = getQuery<Year>()
|
|
|
|
|
query.orderByDescending(Year.COLUMN_NAME)
|
|
|
|
|
query.selectKeys(listOf(
|
|
|
|
|
@ -54,10 +53,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchMission(
|
|
|
|
|
objectId: String?,
|
|
|
|
|
action: (mission: Mission?, e: ParseException?) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
fun fetchMission(objectId: String?, action: (mission: Mission?, e: ParseException?) -> Unit) {
|
|
|
|
|
val query = getQuery<Mission>()
|
|
|
|
|
query.selectKeys(listOf(
|
|
|
|
|
Mission.COLUMN_DATE,
|
|
|
|
|
@ -74,10 +70,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchMissions(
|
|
|
|
|
year: String,
|
|
|
|
|
action: (missions: List<Mission>, e: ParseException?) -> Unit
|
|
|
|
|
) {
|
|
|
|
|
fun fetchMissions(year: String, action: (missions: List<Mission>, e: ParseException?) -> Unit) {
|
|
|
|
|
val query = getQuery<Mission>()
|
|
|
|
|
query.whereEqualTo(Mission.COLUMN_YEAR, Year.emptyObject(year))
|
|
|
|
|
query.orderByDescending(Mission.COLUMN_DATE)
|
|
|
|
|
@ -96,7 +89,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchParticipations(
|
|
|
|
|
fun fetchParticipations(
|
|
|
|
|
missionId: String,
|
|
|
|
|
includeMember: Boolean,
|
|
|
|
|
action: (participations: List<Participation>, e: ParseException?) -> Unit
|
|
|
|
|
@ -124,7 +117,7 @@ object ParseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal fun fetchMembers(
|
|
|
|
|
fun fetchMembers(
|
|
|
|
|
includeInformation: Boolean,
|
|
|
|
|
action: (
|
|
|
|
|
members: List<Member>,
|
|
|
|
|
|