{"version":3,"names":[],"mappings":"","sources":["skillbridge.js"],"sourcesContent":["// {\r\n// \"id\": 0,\r\n// \"created\": \"2022-08-15T21:01:06.733Z\",\r\n// \"firstName\": \"string\",\r\n// \"middleName\": \"string\",\r\n// \"lastName\": \"string\",\r\n// \"address\": \"string\",\r\n// \"city\": \"string\",\r\n// \"stateProvince\": \"string\",\r\n// \"postalCode\": \"string\",\r\n// \"emailAddress\": \"string\",\r\n// \"telephone\": \"string\",\r\n// \"source\": \"string\",\r\n// \"ageFlag\": \"string\",\r\n// \"sponsorshipFlag\": \"string\",\r\n// \"bestContactTime\": \"string\",\r\n// 'bestContactMethod': \"string\",\r\n// \"areasOfInterest\": \"string\",\r\n// \"skills\": \"string\",\r\n// \"resumeFileStoreId\": 0,\r\n// \"emailSentFlag\": true,\r\n// \"emailSentTimeStamp\": \"2022-08-15T21:01:06.733Z\",\r\n// \"availabilityDate\": \"2022-08-15T21:01:06.733Z\",\r\n// \"willingToRelocate\": \"string\",\r\n// \"terminalLeave\": \"string\",\r\n// \"terminalLeaveFrom\": \"2022-08-15T21:01:06.733Z\",\r\n// \"terminalLeaveTo\": \"2022-08-15T21:01:06.733Z\"\r\n//\r\n\r\nlet skillBridgeCAPFileStoreId = 0;\r\n\r\nfunction convertFormToJSON(form) {\r\n const array = $(form).serializeArray(); // Encodes the set of form elements as an array of names and values.\r\n const json = {};\r\n $.each(array, function () {\r\n json[this.name] = this.value || \"\";\r\n });\r\n return json;\r\n}\r\n\r\nfunction getAreasOfInterest() {\r\n const areasOfInterest = [];\r\n const checks = Array.from($('input[name=\"areasOfInterest\"]:checked'));\r\n checks.forEach((item, index) => {\r\n areasOfInterest.push(item.value);\r\n })\r\n return areasOfInterest;\r\n}\r\n\r\n\r\n$(\"#skillbridgeForm\").submit(function(e) {\r\n e.preventDefault();\r\n var form = $(this);\r\n const data = convertFormToJSON(form);\r\n\r\n data.skillBridgeCAPFileStoreId = skillBridgeCAPFileStoreId;\r\n data.areasOfInterest = getAreasOfInterest();\r\n data.middleName = \"\";\r\n // data.sponsorshipFlag = \"\";\r\n\r\n console.log(data);\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://api.employeeworkplace.com/Api/SkillbridgeCandidate/Post\",\r\n data: JSON.stringify(data),\r\n dataType: \"json\",\r\n contentType: \"application/json\",\r\n beforeSend: function (xhr) {\r\n xhr.setRequestHeader ('Authorization', 'Bearer XwgtlQw0sZ2NJsJHJS8pOM7quIiE1vhzXTu1XbQ1fvwXdEnnpSUsOOdBqS8AKJxLya6QUs8RIwN7FPsvArhGVrfTPTCWT8WWZthkxgUvSTsY3zHoBDIAWMdn2IMZl8l9');\r\n },\r\n success: function(data)\r\n {\r\n $(\"#skillbridgeForm\").replaceWith(\r\n `