aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt
blob: ba892f62b4c3037560376f895bb0bcc1f182a8b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package mx.trackermap.TrackerMap.controllers

import mx.trackermap.TrackerMap.client.apis.SessionApi
import mx.trackermap.TrackerMap.client.models.User

class SessionController(private val sessionApi: SessionApi) {
    var user: User? = null

    suspend fun createSession (email: String, password: String) {
        user = sessionApi.sessionPost(email, password)
    }

    suspend fun getSession () {
        user = sessionApi.sessionGet()
    }

    suspend fun deleteSession () {
        sessionApi.sessionDelete()
    }
}