Commit 0f877e866e5c046b0e0966fd339504ce6143c1e9
1 parent
8530576f31
Exists in
admin
issues fixation
Showing
1 changed file
with
47 additions
and
3 deletions
Show diff stats
src/components/Profile.vue
... | ... | @@ -435,6 +435,7 @@ |
435 | 435 | value="" |
436 | 436 | placeholder=" " |
437 | 437 | v-model="cum.comment" |
438 | + v-on:blur="updateComment(cum)" | |
438 | 439 | /> |
439 | 440 | </div> |
440 | 441 | </div> |
... | ... | @@ -500,6 +501,7 @@ export default { |
500 | 501 | |
501 | 502 | data() { |
502 | 503 | return { |
504 | + object:null, | |
503 | 505 | loggedinFlag: false, |
504 | 506 | templateImage:null, |
505 | 507 | caseId: null, |
... | ... | @@ -596,12 +598,27 @@ export default { |
596 | 598 | |
597 | 599 | async slideSelected(i) { |
598 | 600 | console.log("id is", this.templateList[i]); |
599 | - var slideMetadata = {}; | |
600 | - var obj = Object.assign( this.templateList[i],{}); | |
601 | + this.object = JSON.parse(JSON.stringify(this.templateList[i])); | |
602 | + | |
603 | + // var keys = Object.keys(this.templateList[i]); | |
604 | + // keys.forEach(element => { | |
605 | + // obj[element] = this.templateList[i][element]; | |
606 | + // }); | |
607 | + | |
608 | + console.log("obj", this.object) | |
601 | 609 | // slideMetadata = await this.getMeatda(this.templateList[i]._id); |
602 | 610 | this.slideId = null; |
603 | 611 | // this.templateList[i].metaData = slideMetadata.metaData; |
604 | - this.caseStudy.slides.push(obj); | |
612 | + this.caseStudy.slides.push( this.object); | |
613 | + this.templateList[i].metaData.fields.forEach(fields_ => { | |
614 | + fields_.fieldValue == null | |
615 | + }); | |
616 | + if(this.templateList[i].metaData.comments){ | |
617 | + this.templateList[i].metaData.comments.forEach(coments_ => { | |
618 | + coments_.comment == null | |
619 | + }); | |
620 | + | |
621 | + } | |
605 | 622 | console.log("this.caseStudy.slides", this.caseStudy.slides); |
606 | 623 | }, |
607 | 624 | async insightSelected(data) { |
... | ... | @@ -789,6 +806,7 @@ export default { |
789 | 806 | .then((response) => { |
790 | 807 | var finalArray = []; |
791 | 808 | response.data.data.forEach((template_) => { |
809 | + console.log("template_",template_) | |
792 | 810 | var keys = []; |
793 | 811 | var i = this.templateList.findIndex( |
794 | 812 | (temp_) => temp_._id == template_.templateId |
... | ... | @@ -806,6 +824,7 @@ export default { |
806 | 824 | }; |
807 | 825 | if (this.templateList[i].bounceBoard) { |
808 | 826 | obj.commentBox = this.templateList[i].commentBox; |
827 | + obj.metaData.comments = template_.comments; | |
809 | 828 | } |
810 | 829 | if (this.templateList[i].insight) { |
811 | 830 | obj.insightId = template_.insightId; |
... | ... | @@ -873,6 +892,30 @@ export default { |
873 | 892 | this.saveProfile(slidArray); |
874 | 893 | } |
875 | 894 | }, |
895 | + updateComment(cmnt){ | |
896 | + if(!cmnt._id){ | |
897 | + return; | |
898 | + } | |
899 | + console.log("cmnts",cmnt); | |
900 | + var obj = { | |
901 | + 'slideId':cmnt.slideId, | |
902 | + 'commentId':cmnt._id, | |
903 | + 'comment':cmnt.comment | |
904 | + }; | |
905 | + axios | |
906 | + .put("/superAdmin/comment", obj, { | |
907 | + headers: { | |
908 | + Authorization: "Bearer " + this.usertoken, | |
909 | + }, | |
910 | + }) | |
911 | + .then((response) => { | |
912 | + | |
913 | + console.log(response); | |
914 | + }) | |
915 | + .catch((error) => { | |
916 | + | |
917 | + }); | |
918 | + }, | |
876 | 919 | |
877 | 920 | saveProfile(slides) { |
878 | 921 | var obj = {}; |
... | ... | @@ -900,6 +943,7 @@ export default { |
900 | 943 | } |
901 | 944 | }); |
902 | 945 | }, |
946 | + | |
903 | 947 | updateProfile(slides) { |
904 | 948 | var obj = {}; |
905 | 949 | obj.caseStudyId = this.caseId, | ... | ... |