Задача №10

This commit is contained in:
Elena 2018-11-09 13:42:28 +04:00
parent def4f97784
commit 65d788512b
2 changed files with 9 additions and 3 deletions

View File

@ -17,12 +17,16 @@ function showPapers(papersElement) {
});
}
function addPaper(title, status, comment, locked) {
function addPaper(title, status, comment, locked, deadline, file, dateCreate, dateUpdate) {
var paperData = JSON.stringify({
"title": title,
"status": status,
"comment": comment,
"locked": locked
"deadline":deadline,
"locked": locked,
"file":file,
"dateCreate":dateUpdate,
"dateUpdate":dateUpdate
});
postToRest(urlPapers, paperData, function (data) {
alert(data);

View File

@ -149,7 +149,7 @@
<div class="col-lg-12">
<div class="form-group">
<button id="sendMessageButton" class="btn btn-success text-uppercase"
type="submit">
type="submit" onclick="return addPaper()" >
Сохранить
</button>
<button id="cancelButton" class="btn btn-default text-uppercase" type="button">
@ -182,6 +182,8 @@
getFromRest(urlPaperStatuses, function (response) {
fillSelect($("#status"), response);
});
addPaper("название", "DRAFT", "comment", false);
});
/*]]>*/
</script>