Skip to content

Commit 8600eca

Browse files
committed
create update
1 parent 0345826 commit 8600eca

File tree

2 files changed

+46
-51
lines changed

2 files changed

+46
-51
lines changed

public/js/app.js

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,8 +2131,6 @@ __webpack_require__.r(__webpack_exports__);
21312131
//
21322132
//
21332133
//
2134-
//
2135-
//
21362134
/* harmony default export */ __webpack_exports__["default"] = ({
21372135
data: function data() {
21382136
return {
@@ -2142,7 +2140,8 @@ __webpack_require__.r(__webpack_exports__);
21422140
phone: "",
21432141
edit_name: "",
21442142
edit_email: "",
2145-
edit_phone: ""
2143+
edit_phone: "",
2144+
id: ''
21462145
};
21472146
},
21482147
mounted: function mounted() {
@@ -2173,10 +2172,14 @@ __webpack_require__.r(__webpack_exports__);
21732172

21742173
axios.get("edit_student/" + id).then(function (response) {
21752174
console.log(response.data);
2175+
_this2.id = response.data.id;
21762176
_this2.edit_name = response.data.name;
21772177
_this2.edit_email = response.data.email;
21782178
_this2.edit_phone = response.data.phone;
21792179
});
2180+
},
2181+
updateStudent: function updateStudent() {
2182+
console.log(this.id);
21802183
}
21812184
}
21822185
});
@@ -38687,8 +38690,8 @@ var render = function() {
3868738690
_c("div", { staticClass: "modal-content" }, [
3868838691
_vm._m(1),
3868938692
_vm._v(" "),
38690-
_c("div", { staticClass: "modal-body" }, [
38691-
_c("form", [
38693+
_c("form", [
38694+
_c("div", { staticClass: "modal-body" }, [
3869238695
_c("div", { staticClass: "form-group" }, [
3869338696
_c("label", { attrs: { for: "exampleInputEmail1" } }, [
3869438697
_vm._v("Name")
@@ -38771,26 +38774,35 @@ var render = function() {
3877138774
}
3877238775
}
3877338776
})
38774-
]),
38777+
])
38778+
]),
38779+
_vm._v(" "),
38780+
_c("div", { staticClass: "modal-footer" }, [
38781+
_c(
38782+
"button",
38783+
{
38784+
staticClass: "btn btn-secondary",
38785+
attrs: { type: "button", "data-dismiss": "modal" }
38786+
},
38787+
[_vm._v("\n Close\n ")]
38788+
),
3877538789
_vm._v(" "),
3877638790
_c(
3877738791
"button",
3877838792
{
3877938793
staticClass: "btn btn-primary",
38780-
attrs: { type: "submit" },
38794+
attrs: { type: "button" },
3878138795
on: {
3878238796
click: function($event) {
3878338797
$event.preventDefault()
38784-
return _vm.saveStudent($event)
38798+
return _vm.updateStudent($event)
3878538799
}
3878638800
}
3878738801
},
38788-
[_vm._v("\n Submit\n ")]
38802+
[_vm._v("\n Save changes\n ")]
3878938803
)
3879038804
])
38791-
]),
38792-
_vm._v(" "),
38793-
_vm._m(2)
38805+
])
3879438806
])
3879538807
]
3879638808
)
@@ -38841,27 +38853,6 @@ var staticRenderFns = [
3884138853
[_c("span", { attrs: { "aria-hidden": "true" } }, [_vm._v("×")])]
3884238854
)
3884338855
])
38844-
},
38845-
function() {
38846-
var _vm = this
38847-
var _h = _vm.$createElement
38848-
var _c = _vm._self._c || _h
38849-
return _c("div", { staticClass: "modal-footer" }, [
38850-
_c(
38851-
"button",
38852-
{
38853-
staticClass: "btn btn-secondary",
38854-
attrs: { type: "button", "data-dismiss": "modal" }
38855-
},
38856-
[_vm._v("\n Close\n ")]
38857-
),
38858-
_vm._v(" "),
38859-
_c(
38860-
"button",
38861-
{ staticClass: "btn btn-primary", attrs: { type: "button" } },
38862-
[_vm._v("Save changes")]
38863-
)
38864-
])
3886538856
}
3886638857
]
3886738858
render._withStripped = true

resources/js/components/CreateComponent.vue

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@
121121
<span aria-hidden="true">&times;</span>
122122
</button>
123123
</div>
124-
<div class="modal-body">
125-
<form>
124+
<form>
125+
<div class="modal-body">
126126
<div class="form-group">
127127
<label for="exampleInputEmail1">Name</label>
128128
<input
@@ -150,26 +150,24 @@
150150
placeholder="Enter Phone"
151151
/>
152152
</div>
153-
153+
</div>
154+
<div class="modal-footer">
154155
<button
155-
type="submit"
156-
v-on:click.prevent="saveStudent"
156+
type="button"
157+
class="btn btn-secondary"
158+
data-dismiss="modal"
159+
>
160+
Close
161+
</button>
162+
<button
163+
type="button"
164+
v-on:click.prevent="updateStudent"
157165
class="btn btn-primary"
158166
>
159-
Submit
167+
Save changes
160168
</button>
161-
</form>
162-
</div>
163-
<div class="modal-footer">
164-
<button
165-
type="button"
166-
class="btn btn-secondary"
167-
data-dismiss="modal"
168-
>
169-
Close
170-
</button>
171-
<button type="button" class="btn btn-primary">Save changes</button>
172-
</div>
169+
</div>
170+
</form>
173171
</div>
174172
</div>
175173
</div>
@@ -188,6 +186,8 @@ export default {
188186
edit_name: "",
189187
edit_email: "",
190188
edit_phone: "",
189+
190+
id: '',
191191
};
192192
},
193193
mounted() {
@@ -214,11 +214,15 @@ export default {
214214
editStudent(id) {
215215
axios.get("edit_student/" + id).then((response) => {
216216
console.log(response.data);
217+
this.id = response.data.id;
217218
this.edit_name = response.data.name;
218219
this.edit_email = response.data.email;
219220
this.edit_phone = response.data.phone;
220221
});
221222
},
223+
updateStudent(){
224+
console.log(this.id);
225+
},
222226
},
223227
};
224228
</script>

0 commit comments

Comments
 (0)