Files
openfoodnetwork/app/webpacker/controllers/resend_confirmation_email_controller.js
Jean-Baptiste Bellet 7e844ee289 Implement resend email confirmation bulk action
- Create a controller that send a reflex action with the order_ids array
2023-01-03 10:32:11 +01:00

19 lines
446 B
JavaScript

import ApplicationController from "./application_controller";
export default class extends ApplicationController {
connect() {
super.connect();
}
confirm() {
const order_ids = [];
document
.querySelectorAll("#listing_orders input[name='order_ids[]']:checked")
.forEach((checkbox) => {
order_ids.push(checkbox.value);
});
this.stimulate("ResendConfirmationEmailReflex#confirm", order_ids);
}
}