PageSourceSearch

https://app.vpmsolutions.com/addOrUpdateEducation.component63916.js

js vpmsolutions.com collected 2026-10-04 02:04:04 UTC 5,920 bytes, 1 lines download raw bytes

1import{d as I,a as O,B as G,I as N,w as v,$ as R,o as y,f as w,g as T,j as n,h as u,e as t,N as x,aH as l,aZ as j,s as F,P,c as H,r as Q,E as W,a3 as s,af as b,a5 as p,ag as L}from"./index63916.js";import{C as Z}from"./checkboxInput.component63916.js";import{_ as E}from"./datePicker.component.vue_vue_type_script_setup_true_lang63916.js";import{e as z}from"./settingsAssistantEducation.view63916.js";import"./CalendarDaysIcon63916.js";import"./ChevronDownIcon63916.js";import"./index6391624.js";import"./EllipsisVerticalIcon63916.js";import"./ArrowLeftIcon639162.js";const J={class:"mt-4 grid w-full grid-cols-12 gap-4"},K={class:"col-span-12"},X={class:"col-span-12"},ee={class:"col-span-12 sm:col-span-6"},te={class:"col-span-12 sm:col-span-6"},ae={class:"mt-2"},oe={class:"col-span-12"},pe=I({__name:"addOrUpdateEducation.component",props:{modelValue:{type:Boolean},education:{},isEdit:{type:Boolean}},emits:["update:modelValue"],setup(U,{emit:A}){const i=U,S=A;let g=O(),B=G(),e=P({institution:"",degree:"",startDate:"",graduationDate:"",description:"",current:!1});const Y=(o,a)=>{if(a==="Attending")return!0;if(o&&a){const r=l.utc(o).toDate(),m=l.utc(a).add(1,"day").toDate();return r<m}return!0},_=H(()=>({institution:{required:s.withMessage("School name is required",p),minLength:s.withMessage("School name must be at least 2 characters",L(2)),maxLength:s.withMessage("School name must be at most 50 characters",b(50))},degree:{required:s.withMessage("Degree title is required",p),minLength:s.withMessage("Degree title must be at least 2 characters",L(2)),maxLength:s.withMessage("Degree title must be at most 50 characters",b(50))},startDate:{minLength:s.withMessage("Start date is required",p),verifyDateRange:s.withMessage("Start date must be before end date",()=>Y(e.startDate,e.graduationDate))},graduationDate:{minLength:s.withMessage("Graduation date is required",p)},description:{maxLength:s.withMessage("Description must be at most 2000 characters",b(2e3))}})),d=N(_.value,e),k=()=>{e.institution="",e.degree="",e.startDate="",e.graduationDate="",e.description="",e.current=!1},D=o=>{e.institution=o.institution,e.degree=o.degree,e.startDate=o.startDate?l.utc(o.startDate).add(1,"day").toDate().toISOString():"",e.graduationDate=o.graduationDate==="Attending"?o.graduationDate:o.graduationDate?l.utc(o.graduationDate).add(1,"day").toDate().toISOString():"",e.description=o.description?o.description:"",e.current=o.graduationDate==="Attending"};v(()=>i.modelValue,o=>{o&&(d.value.$reset(),i.education&&i.isEdit?D(i.education):k())}),v(()=>i.education,o=>{o&&D(o)}),v(()=>e.current,o=>{o&&(e.graduationDate="Attending"),o||(e.graduationDate="")}),R(()=>{i.modelValue&&i.education&&i.isEdit&&D(i.education)});let h=Q(!1);const q=async()=>{var r,m,M,$;if(!await d.value.$validate())return;h.value=!0;let a={institution:e.institution,degree:e.degree,startDate:l.utc(e.startDate).toDate(),graduationDate:e.graduationDate==="Attending"?e.graduationDate:new Date(e.graduationDate),description:e.description,educationId:(r=i.education)!=null&&r.id?i.education.id:void 0};try{let c=await z.updateOrCreateEducation(a);if(c.data.success){let{education:f}=c.data.data;if(i.isEdit){let V=(m=g.educations)==null?void 0:m.findIndex(C=>C.id===f.id);V!==void 0&&V!==-1&&((M=g.educations)==null||M.splice(V,1,f))}else($=g.educations)==null||$.push({...f});B.success({title:"Success",message:"Work experience updated successfully"}),S("update:modelValue",!1)}}catch(c){W.error(c)}finally{h.value=!1}};return(o,a)=>
1(y(),w(t(F),{open:i.modelValue,title:i.isEdit?"Update Education":"Add Education",onClose:a[7]||(a[7]=r=>S("update:modelValue",!1)),onConfirmAction:a[8]||(a[8]=r=>q()),isBusy:t(h)},{content:T(()=>[n("div",null,[a[9]||(a[9]=n("p",{class:"text-sm text-gray-500"}," Please provide the details of your school history. This will help us to match you with the right jobs. ",-1)),n("div",J,[n("div",K,[u(t(x),{modelValue:t(e).institution,"onUpdate:modelValue":a[0]||(a[0]=r=>t(e).institution=r),id:"school-name",type:"text",autocomplete:"school-name",label:"School name",placeholder:"Quinnipiac University",error:t(d).institution.$errors},null,8,["modelValue","error"])]),n("div",X,[u(t(x),{modelValue:t(e).degree,"onUpdate:modelValue":a[1]||(a[1]=r=>t(e).degree=r),id:"degree",type:"text",autocomplete:"degree",label:"Degree",placeholder:"Engineering",error:t(d).degree.$errors},null,8,["modelValue","error"])]),n("div",ee,[u(t(E),{modelValue:t(e).startDate,"onUpdate:modelValue":a[2]||(a[2]=r=>t(e).startDate=r),id:"start-date",label:"Start date",placeholder:"MM/DD/YYYY",maxDate:t(l).utc().toDate(),error:t(d).startDate.$errors},null,8,["modelValue","maxDate","error"])]),n("div",te,[t(e).current?(y(),w(t(x),{key:1,modelValue:t(e).graduationDate,"onUpdate:modelValue":a[4]||(a[4]=r=>t(e).graduationDate=r),id:"end-date",type:"text",autocomplete:"end-date",label:"Graduation date",placeholder:"Attending",error:t(d).graduationDate.$errors,disabled:""},null,8,["modelValue","error"])):(y(),w(t(E),{key:0,modelValue:t(e).graduationDate,"onUpdate:modelValue":a[3]||(a[3]=r=>t(e).graduationDate=r),id:"end-date",label:"Graduation date",placeholder:"MM/DD/YYYY",minDate:t(e).startDate?new Date(t(l).utc(t(e).startDate).add(2,"days").toDate()):void 0,maxDate:t(l).utc().toDate(),error:t(d).graduationDate.$errors},null,8,["modelValue","minDate","maxDate","error"])),n("div",ae,[u(t(Z),{modelValue:t(e).current,"onUpdate:modelValue":a[5]||(a[5]=r=>t(e).current=r),id:"current",label:"Attending"},null,8,["modelValue"])])]),n("div",oe,[u(t(j),{modelValue:t(e).description,"onUpdate:modelValue":a[6]||(a[6]=r=>t(e).description=r),optional:!0,id:"description",label:"Description",placeholder:"Describe your achievements or any other relevant information.",rows:5,maxLength:2e3,showLength:!0,error:t(d).description.$errors},null,8,["modelValue","error"])])])])]),_:1},8,["open","title","isBusy"]))}});export{pe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.