Skip to content

Commit

Permalink
refactor(frontend): Update message template variables in SendOrder co…
Browse files Browse the repository at this point in the history
…mponent
  • Loading branch information
4lysson-a committed Sep 21, 2024
1 parent ee82d1f commit 0802b7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/pages/Menu/Cart/Modal/SendOrder/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default function SendOrder({ totalPrice }) {
.join("\n");

const message = msgTemplate
.replace("{nome}", name)
.replace("{produtos}", order)
.replace("{valor}", `R$ ${totalPrice}`);
.replace(/{nome}/g, name)
.replace(/{produtos}/g, order)
.replace(/{valor}/g, `R$ ${totalPrice}`);

const url = `https://wa.me/${phone}?text=${encodeURIComponent(message)}`;
window.open(url, "_blank");
Expand Down

0 comments on commit 0802b7c

Please sign in to comment.