Skip to content

Commit

Permalink
fix: remove CEDEX
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Apr 29, 2023
1 parent 970fb52 commit 7e9d859
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,15 @@ form.addEventListener('submit', (e) => {
window.addEventListener('load', () => {
window.electronAPI.onSchoolList((_, schools) => {
schoolsElem.innerHTML = ''
schools.forEach((school) => {
const schooHTML = `<b class="school-name">${
school.name
}</b><span class="school-ems">(${
school.emsCode
})</span>-<i class="school-city">${school.city
.replace(/CEDEX ([0-9]+)/, '')
.trim()} ${
school.zipCode
}</i><button class="school-select">Choisir</button>`
schools.forEach(school => {
const schooHTML = `<b class="school-name" title="${school.id}">${school.name}</b>
<span class="school-ems">(${school.emsCode})</span> -
<i class="school-city">${school.city.replace('CEDEX', '').trim()} ${school.zipCode}</i>
<button class="school-select">Choisir</button>`

const li = document.createElement('li')
li.innerHTML = schooHTML
li.querySelector('.school-select').addEventListener(
'click',
async () => {
window.electronAPI.schoolAuth(school)
}
)
li.querySelector('button').addEventListener('click', () => window.electronAPI.schoolAuth(school))
schoolsElem.appendChild(li)
})
})
Expand Down

0 comments on commit 7e9d859

Please # to comment.