36 lines
762 B
JavaScript
36 lines
762 B
JavaScript
const createBtn = document.getElementById("create-button");
|
|
const nameInput = document.getElementById("name-input");
|
|
|
|
createBtn.addEventListener("click", () => {
|
|
if (!correctData()) {
|
|
return;
|
|
}
|
|
if (!validate()) {
|
|
return;
|
|
}
|
|
});
|
|
|
|
const correctData = function () {
|
|
|
|
return true;
|
|
};
|
|
|
|
const validate = function () {
|
|
|
|
return true;
|
|
};
|
|
|
|
createBtn.addEventListener("click", () => {
|
|
let specialization = {
|
|
"Name": nameInput.value,
|
|
};
|
|
console.log(specialization)
|
|
$.ajax({
|
|
url: "/specialization/create",
|
|
type: "POST",
|
|
contentType: "application/json",
|
|
data: JSON.stringify(specialization)
|
|
}).done(() => {
|
|
window.location.href = "/Home/Specializations";
|
|
});
|
|
}); |