//
//  PostPLJobIView+.swift
//  IOS_study
//
//  Created by CC-star on 2025/6/29.
//

import SwiftUI

extension PostPLJobIView {
   func postJob() {
      if let incalidMsg = incalidMsg {//也可以写成if let incalidMsg
         hud.show(incalidMsg)
         return
      }
//      print("输入ok")
      workPlaceName = draftJob.placeName
      workProvince = draftJob.province
      workCity = draftJob.city
      workContact = draftJob.contact
      
      vm.draftJob.companyName = "阿里巴巴"
      
      vm.postJob()
      
      if isEditing {
         hud.show("修改成功")
         if !naviPath.isEmpty {
            naviPath.removeLast()
         }
      } else {
         hud.show("发布成功")
         vm.jobs.append(vm.job)
         tabbarVM.selectedTab = "job"
      }
      vm.draftJob = PLJob()
   }
}
