Skip to content

Instantly share code, notes, and snippets.

@mig15
Created July 29, 2019 10:43
Show Gist options
  • Save mig15/ed57e2856bd9539e6f73c84bc354f909 to your computer and use it in GitHub Desktop.
Save mig15/ed57e2856bd9539e6f73c84bc354f909 to your computer and use it in GitHub Desktop.
override fun sendResume() {
scope.launch {
loading {
runCatching {
val addInfo = CreateResumePostRequest.Topic.AddInfo(email = questionParam.email,
phone = questionParam.phone)
val view = CreateResumePostRequest.Topic.JsonView.View(professionality = questionParam.professionalArea,
salary = questionParam.money,
skills = questionParam.skills,
text = questionParam.aboutMe,
vacancyName = questionParam.position,
currency = questionParam.currency)
val jsonView = CreateResumePostRequest.Topic.JsonView(view = view)
val topic = CreateResumePostRequest.Topic(addInfo = addInfo,
jsonView = jsonView,
region = questionParam.regions)
val fileList = arrayListOf<CreateResumePostRequest.File>()
for (item in questionParam.adapterFileList) {
item as CreateAnimalHusbandryQuestionVM.AdapterFileItem
fileList.add(CreateResumePostRequest.File(fileId = item.id,
caption = item.path,
fileCaption = item.path))
}
val body = CreateResumePostRequest(visibility = questionParam.visible.id,
text = questionParam.position,
topic = topic,
files = fileList)
facade.sendResume(body)
}.exceptionOrNull()?.showAlertDialog(activityController)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment