Skip to content

Commit

Permalink
feat: Expose verifyEmailCode through the UploadManager like other met…
Browse files Browse the repository at this point in the history
…hods
  • Loading branch information
LunarX committed Dec 12, 2024
1 parent d3bf76f commit e267d0a
Showing 1 changed file with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ import com.infomaniak.multiplatform_swisstransfer.data.NewUploadSession
import com.infomaniak.multiplatform_swisstransfer.database.controllers.UploadController
import com.infomaniak.multiplatform_swisstransfer.exceptions.NotFoundException
import com.infomaniak.multiplatform_swisstransfer.exceptions.NullPropertyException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ApiException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ContainerErrorsException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.NetworkException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.UnexpectedApiErrorFormatException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.*
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.FinishUploadBody
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.InitUploadBody
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.ResendEmailCodeBody
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.VerifyEmailCodeBody
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.response.AuthorEmailToken
import com.infomaniak.multiplatform_swisstransfer.network.models.upload.response.UploadCompleteResponse
import com.infomaniak.multiplatform_swisstransfer.network.repositories.UploadRepository
import com.infomaniak.multiplatform_swisstransfer.utils.EmailLanguageUtils
Expand Down Expand Up @@ -317,6 +316,18 @@ class UploadManager(
uploadController.removeData()
}

@Throws(
CancellationException::class,
EmailValidationException::class,
ApiException::class,
NetworkException::class,
UnexpectedApiErrorFormatException::class,
UnknownException::class,
)
suspend fun verifyEmailCode(code: String, email: String): AuthorEmailToken {
return uploadRepository.verifyEmailCode(VerifyEmailCodeBody(code, email))
}

@Throws(
CancellationException::class,
ApiException::class,
Expand Down

0 comments on commit e267d0a

Please sign in to comment.