Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatprabha committed Oct 23, 2018
1 parent 469b7ec commit 512e5b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<v-dialog v-if="showProposalDialogButton" v-model="proposalDialog" max-width="900">
<ProposalCreateUpdate
:mode="$route.name === 'Dashboard' ? 'update':'apply'"
:updateId="getProposalUpdateIdByProjectId(project.id)"
:baseProposal="getProposalByProjectId(project.id)"
:projectId="project.id"
@close_dialog="proposalDialog = false"/>
</v-dialog>
Expand Down Expand Up @@ -95,8 +95,8 @@
if (mentor) return `${mentor.first_name} ${mentor.last_name}`
else return ''
},
getProposalUpdateIdByProjectId (projectId) {
return this.studentProposalList.find(proposal => proposal.project === projectId).id || null
getProposalByProjectId (projectId) {
return this.studentProposalList.find(proposal => proposal.project === projectId)
},
remove () {
this.$httpClient.delete(`/api/project/projects/${this.project.id}/`).then(response => {
Expand Down
19 changes: 9 additions & 10 deletions ui/src/components/ProposalCreateUpdate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
export default {
name: 'ProposalCreateUpdate',
props: ['mode', 'updateId', 'projectId'],
props: ['mode', 'baseProposal', 'projectId'],
data: () => ({
proposal: {
id: '',
Expand Down Expand Up @@ -100,7 +100,7 @@
})
},
performUpdate () {
this.$httpClient.patch(`/api/project/student-proposal/${this.updateId}/`, {
this.$httpClient.patch(`/api/project/student-proposal/${this.baseProposal.id}/`, {
drive_link: this.proposal.drive_link
}).then(response => {
this.updateProposal(_.cloneDeep(response.data))
Expand All @@ -118,17 +118,16 @@
})
},
setProposal () {
if (this.updateId) {
const proposal = this.studentProposalList.find(proposal => proposal.id === this.updateId)
if (proposal) this.proposal = _.cloneDeep(proposal)
else {
this.$httpClient.get(`/api/project/student-proposal/${this.updateId}/`).then(response => {
this.proposal = response.data
})
}
if (this.baseProposal) {
this.proposal = _.cloneDeep(this.baseProposal)
}
}
},
watch: {
baseProposal (value) {
if (value !== undefined) this.proposal = _.cloneDeep(value)
}
},
filters: {
capitalize: value => value.charAt(0).toUpperCase() + value.slice(1)
}
Expand Down

0 comments on commit 512e5b2

Please sign in to comment.