Skip to content

Commit

Permalink
correction
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoLombardo committed Jul 22, 2024
1 parent bb9ba81 commit 2bbc8b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/javascript/controllers/destinations_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export default class extends Controller {
const newDestination = this.templateTarget.content.cloneNode(true)
const inputs = newDestination.querySelectorAll('input')
const id = this.formTarget.childElementCount
for (let i = 0; i < inputs.length; i++) {
inputs[i].setAttribute('name', inputs[i].getAttribute('name').replace('[template]', `[destinations_attributes][${id}]`))
inputs[i].setAttribute('id', inputs[i].getAttribute('id').replace('[template]', `destinations_attributes_${id}`))
inputs[i].value = ''
}
inputs.forEach(input => {
input.setAttribute('name', input.getAttribute('name').replace('[template]', `[destinations_attributes][${id}]`))
input.setAttribute('id', input.getAttribute('id').replace('[template]', `destinations_attributes_${id}`))
input.value = ''
})
newDestination.querySelector('div').classList.add(this.paddingWebClass, this.paddingMobileClass)
this.formTarget.appendChild(newDestination)
this.errorRemoveTarget.classList.add(this.hideClass)
Expand Down
2 changes: 1 addition & 1 deletion app/views/purchases/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<%= image_tag('remove.svg', class:'img-destinations')%>
</button>
</div>
<p class= "fs-1 mb-0 ms-3 text-danger d-none" data-destinations-target = "errorRemove">La entrega debe tener al menos un destinatario </p>
<p class= "fs-sm-5 fs-lg-1 mb-0 ms-3 text-danger d-none" data-destinations-target = "errorRemove">La entrega debe tener al menos un destinatario </p>
</div>
</div>
<div class="form-check form-switch d-flex mb-4 my-lg-2 ">
Expand Down

0 comments on commit 2bbc8b2

Please sign in to comment.