(self.webpackChunkInstiKit=self.webpackChunkInstiKit||[]).push([[8584],{9815:(o,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s});const n={components:{bookConditionForm:i(80807).Z},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}};const s=(0,i(51900).Z)(n,(function(){var o=this,t=o.$createElement,i=o._self._c||t;return i("div",[i("div",{staticClass:"page-titles"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12 col-sm-6"},[i("h3",{staticClass:"text-themecolor"},[o._v(o._s(o.trans("library.edit_book_condition")))])]),o._v(" "),i("div",{staticClass:"col-12 col-sm-6"},[i("div",{staticClass:"action-buttons pull-right"},[i("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return o.$router.push("/configuration/library/book/condition")}}},[i("i",{staticClass:"fas fa-list"}),o._v(" "),i("span",{staticClass:"d-none d-sm-inline"},[o._v(o._s(o.trans("library.book_condition")))])])])])])]),o._v(" "),i("div",{staticClass:"container-fluid"},[i("div",{staticClass:"card card-form"},[i("div",{staticClass:"card-body p-t-20"},[i("book-condition-form",{attrs:{id:o.id}})],1)])])])}),[],!1,null,null,null).exports},80807:(o,t,i)=>{"use strict";i.d(t,{Z:()=>s});const n={data:function(){return{bookConditionForm:new Form({name:"",description:""})}},props:["id"],mounted:function(){this.id&&this.get()},methods:{proceed:function(){this.id?this.update():this.store()},store:function(){var o=this,t=this.$loading.show();this.bookConditionForm.post("/api/library/book/condition").then((function(i){toastr.success(i.message),o.$emit("completed"),t.hide()})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))},get:function(){var o=this,t=this.$loading.show();axios.get("/api/library/book/condition/"+this.id).then((function(i){o.bookConditionForm.name=i.name,o.bookConditionForm.description=i.description,t.hide()})).catch((function(i){t.hide(),helper.showErrorMsg(i),o.$router.push("/configuration/library/book/condition")}))},update:function(){var o=this,t=this.$loading.show();this.bookConditionForm.patch("/api/library/book/condition/"+this.id).then((function(i){toastr.success(i.message),t.hide(),o.$router.push("/configuration/library/book/condition")})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))}}};const s=(0,i(51900).Z)(n,(function(){var o=this,t=o.$createElement,i=o._self._c||t;return i("form",{on:{submit:function(t){return t.preventDefault(),o.proceed.apply(null,arguments)},keydown:function(t){return o.bookConditionForm.errors.clear(t.target.name)}}},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12 col-sm-6"},[i("div",{staticClass:"form-group"},[i("label",{attrs:{for:""}},[o._v(o._s(o.trans("library.book_condition_name")))]),o._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:o.bookConditionForm.name,expression:"bookConditionForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:o.trans("library.book_condition_name")},domProps:{value:o.bookConditionForm.name},on:{input:function(t){t.target.composing||o.$set(o.bookConditionForm,"name",t.target.value)}}}),o._v(" "),i("show-error",{attrs:{"form-name":o.bookConditionForm,"prop-name":"name"}})],1)]),o._v(" "),i("div",{staticClass:"col-12 col-sm-6"},[i("div",{staticClass:"form-group"},[i("label",{attrs:{for:""}},[o._v(o._s(o.trans("library.book_condition_description")))]),o._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:o.bookConditionForm.description,expression:"bookConditionForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:o.trans("library.book_condition_description")},domProps:{value:o.bookConditionForm.description},on:{input:function(t){t.target.composing||o.$set(o.bookConditionForm,"description",t.target.value)}}}),o._v(" "),i("show-error",{attrs:{"form-name":o.bookConditionForm,"prop-name":"description"}})],1)])]),o._v(" "),i("div",{staticClass:"card-footer text-right"},[i("router-link",{directives:[{name:"show",rawName:"v-show",value:o.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/library/book/condition"}},[o._v(o._s(o.trans("general.cancel")))]),o._v(" "),o.id?o._e():i("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(t){return o.$emit("cancel")}}},[o._v(o._s(o.trans("general.cancel")))]),o._v(" "),i("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[o.id?i("span",[o._v(o._s(o.trans("general.update")))]):i("span",[o._v(o._s(o.trans("general.save")))])])],1)])}),[],!1,null,null,null).exports}}]);
//# sourceMappingURL=edit.js.map?id=136c1666370a54b02a02