Skip to content

Commit

Permalink
#167: Apenas que graduandos aptos editam CRG
Browse files Browse the repository at this point in the history
  • Loading branch information
lubien committed Jun 27, 2019
1 parent 6a9c7e5 commit a28f252
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions components/studentComboBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
type="number"
:min="0"
:max="10"
:disabled="!canEdit"
:disabled="!canEdit || !canEditCrg"
@blur="onCrgBlur"
></b-input>
<br />
Expand Down Expand Up @@ -234,6 +234,13 @@ export default {
set(newValue) {
this.studentData.cd = newValue ? '1' : '0'
}
},
canEditCrg() {
return (
Boolean(this.studentData.isGraduating) &&
Boolean(this.studentData.isFit)
)
}
},
Expand Down Expand Up @@ -267,7 +274,9 @@ export default {
this.isLoading = true
const endpoint = `/api/students/${this.studentData.id}`
const payload = this.studentData
const { defenseDate, email, cd } = this.studentData
const crg = this.canEditCrg ? this.studentData.crg : undefined
const payload = { defenseDate, email, cd, crg }
this.$axios
.$put(endpoint, payload)
.then(data => {
Expand Down

0 comments on commit a28f252

Please sign in to comment.