(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-96000356"],{"0745":function(a,t,e){"use strict";e("b38b")},a665:function(a,t,e){"use strict";e("cbf5")},b38b:function(a,t,e){},cbf5:function(a,t,e){},f9c0:function(a,t,e){"use strict";e.r(t);var i=function(){var a=this,t=a._self._c;return t("div",{staticClass:"main-content"},[t("breadcumb",{attrs:{page:"Edit Project Update",folder:"Projects",link:"/app/projects/".concat(a.$route.params.uuidWakaf)}}),t("b-col",{attrs:{md:"12"}},[t("b-overlay",{attrs:{show:a.loading,rounded:"sm"}},[t("b-card",{ref:"formContainer",staticClass:"wrapper"},[t("b-form",{on:{submit:function(t){return t.preventDefault(),a.handleUpdateCampaignUpdate.apply(null,arguments)}}},[t("b-form-group",{staticClass:"col-md-12 mb-3",attrs:{label:"Judul Project Update :","label-for":"input-1"}},[t("b-form-input",{directives:[{name:"validate",rawName:"v-validate",value:"required|min:10",expression:"'required|min:10'"}],class:{input:!0,"is-danger":a.errors.has("judul project update")},attrs:{type:"text",placeholder:"Input Judul Project Update",name:"judul project update"},model:{value:a.detailCampaignUpdate.titleCampaignUpdate,callback:function(t){a.$set(a.detailCampaignUpdate,"titleCampaignUpdate",t)},expression:"detailCampaignUpdate.titleCampaignUpdate"}}),t("p",{directives:[{name:"show",rawName:"v-show",value:a.errors.has("judul project update"),expression:"errors.has('judul project update')"}],staticClass:"text-danger"},[a._v(" "+a._s(a.errors.first("judul project update"))+" ")])],1),t("b-form-group",{staticClass:"col-md-12 mb-3",attrs:{label:"Deksripsi Project Update :","label-for":"input-1"}},[t("vue-editor",{directives:[{name:"validate",rawName:"v-validate",value:"required|min:20",expression:"'required|min:20'"}],class:{input:!0,"is-danger":a.errors.has("deskripsi project update")},attrs:{useCustomImageHandler:"",name:"deskripsi project update"},on:{"image-added":a.handleImageAdded},model:{value:a.detailCampaignUpdate.descCampaignUpdate,callback:function(t){a.$set(a.detailCampaignUpdate,"descCampaignUpdate",t)},expression:"detailCampaignUpdate.descCampaignUpdate"}}),t("p",{directives:[{name:"show",rawName:"v-show",value:a.errors.has("deskripsi project update"),expression:"errors.has('deskripsi project update')"}],staticClass:"text-danger"},[a._v(" "+a._s(a.errors.first("deskripsi project update"))+" ")])],1),t("b-col",{attrs:{md:"12"}},[t("b-button",{staticClass:"mt-3",attrs:{type:"submit",variant:"primary",disabled:a.disabledBtnSave||a.loading}},[a._v("Save")])],1)],1)],1)],1)],1)],1)},r=[],d=(e("99af"),e("14d9"),e("5873")),s={components:{VueEditor:d["a"]},data:function(){return{loading:!0,detailCampaignUpdate:{campaignUpdateId:"",titleCampaignUpdate:"",descCampaignUpdate:""}}},mounted:function(){this.getDetailCampaignUpdate()},methods:{handleImageAdded:function(a,t,e,i){var r=this,d=new FormData;d.append("file",a),this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","file-assets"),d,{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(a){var r=a.data.file_url;t.insertEmbed(e,"image",r),i()})).catch((function(a){r.$store.dispatch("error",a)}))},getDetailCampaignUpdate:function(){var a=this;this.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","campaign-updates/").concat(this.$route.params.uuid),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(t){var e=t.data;a.detailCampaignUpdate={campaignUpdateId:e.wakaf_update_id,titleCampaignUpdate:e.wakaf_update_title,descCampaignUpdate:e.wakaf_update_description},a.loading=!1})).catch((function(){a.loading=!1,a.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleUpdateCampaignUpdate:function(){var a=this;this.loading=!0;var t=this.$loading.show({container:this.$refs.formContainer});this.$validator.validateAll().then((function(e){e?a.$http.patch("".concat("https://orchestrator.bwa.id/api/v1/","campaign-updates/").concat(a.detailCampaignUpdate.campaignUpdateId),{wakaf_update_title:a.detailCampaignUpdate.titleCampaignUpdate,wakaf_update_description:a.detailCampaignUpdate.descCampaignUpdate},{headers:{Authorization:"Bearer ".concat(a.$store.getters["accessToken"])}}).then((function(){a.loading=!1,t.hide(),a.$store.dispatch("success","Project update berhasil diubah"),a.$router.push("/app/projects/".concat(a.$route.params.uuidWakaf,"/detail"))})).catch((function(){a.loading=!1,t.hide(),a.$store.dispatch("error","Maaf, terjadi kesalahan")})):(a.loading=!1,t.hide())}))}}},n=s,p=(e("0745"),e("a665"),e("2877")),o=Object(p["a"])(n,i,r,!1,null,"4f2758b6",null);t["default"]=o.exports}}]);