JS corrections in ChillPersonBundle required by ESLint

This commit is contained in:
2024-11-12 15:38:46 +01:00
parent dd854ea339
commit 22ecb11227
15 changed files with 32 additions and 41 deletions

View File

@@ -342,7 +342,7 @@ export default {
return makeFetch('POST', '/api/1.0/person/household/members/move.json', member)
.then(_response => {
makeFetch('POST', `/api/1.0/person/household/${responseHousehold.id}/address.json`, address)
.then(_response => {})
.then(_response => {console.log(_response)})
.catch((error) => {
if (error.name === 'ValidationException') {
for (let v of error.violations) {

View File

@@ -96,7 +96,7 @@ export default {
}
},
methods: {
saveFormOnTheFly({data, type}) {
saveFormOnTheFly({data}) {
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
.then(response => {
this.$emit('newPriorSuggestion', response);

View File

@@ -336,14 +336,14 @@ export default {
}
},
altNameLabel: function () {
for (let i = 0; i < this.person.altNames.length; i++) {
return this.person.altNames[i].label
}
let altNameLabel = ''
this.person.altNames.forEach(altName => altNameLabel += altName.label)
return altNameLabel
},
altNameKey: function () {
for (let i = 0; i < this.person.altNames.length; i++) {
return this.person.altNames[i].key
}
let altNameKey = ''
this.person.altNames.forEach(altName => altNameKey += altName.key)
return altNameKey
},
getUrl: function () {
return `/fr/person/${this.person.id}/general`;

View File

@@ -45,14 +45,14 @@ export default {
},
computed: {
altNameLabel: function() {
for(let i = 0; i < this.person.altNames.length; i++){
return this.person.altNames[i].label
}
let altNameLabel = ''
this.person.altNames.forEach(altName => altNameLabel += altName.label)
return altNameLabel
},
altNameKey: function() {
for(let i = 0; i < this.person.altNames.length; i++){
return this.person.altNames[i].key
}
let altNameKey = ''
this.person.altNames.forEach(altName => altNameKey += altName.key)
return altNameKey
},
cutText: function() {
let more = (this.person.text.length > 15) ?'…' : '';

View File

@@ -436,7 +436,7 @@ export default {
}
},
methods: {
checkErrors(e) {
checkErrors() {
this.errors = [];
if (this.person.lastName === "") {
this.errors.push("Le nom ne doit pas être vide.");
@@ -453,7 +453,7 @@ export default {
},
loadData() {
getPerson(this.id)
.then(person => new Promise((resolve, reject) => {
.then(person => new Promise((resolve) => {
this.person = person;
//console.log('get person', this.person);
resolve();