fix: conserta token de auth nas notificacoes e payload do evolution api v2
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 1m6s
Details
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 1m6s
Details
This commit is contained in:
parent
9efcf4f4b1
commit
85eb68c771
|
|
@ -2291,11 +2291,11 @@ app.post('/api/admin/reply-message', authenticateToken, requireAdmin, async (req
|
|||
if (cleanPhone.length >= 10) {
|
||||
const numberId = `${cleanPhone}@s.whatsapp.net`;
|
||||
const url = `${settings.evolutionApiUrl}/message/sendText/${settings.evolutionInstance}`;
|
||||
|
||||
await axios.post(url, {
|
||||
number: numberId,
|
||||
text: message,
|
||||
options: { delay: 1200, linkPreview: true }
|
||||
delay: 1200,
|
||||
linkPreview: true
|
||||
}, {
|
||||
headers: {
|
||||
'apikey': settings.evolutionApiKey,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export default function Navbar({ user, activeView, setView, onLogout, settings }
|
|||
try {
|
||||
// In a real app we would pass the token or it would be in cookies
|
||||
// Assuming server uses some auth, for demo we might just fetch
|
||||
const token = localStorage.getItem('token');
|
||||
const token = localStorage.getItem('app_token') || localStorage.getItem('admin_token');
|
||||
if (!token) return;
|
||||
const res = await fetch('/api/notifications', {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
|
|
@ -63,7 +63,7 @@ export default function Navbar({ user, activeView, setView, onLogout, settings }
|
|||
|
||||
const markAsRead = async (id: string) => {
|
||||
try {
|
||||
const token = localStorage.getItem('token');
|
||||
const token = localStorage.getItem('app_token') || localStorage.getItem('admin_token');
|
||||
if (!token) return;
|
||||
await fetch(`/api/notifications/${id}/read`, {
|
||||
method: 'PUT',
|
||||
|
|
|
|||
Loading…
Reference in New Issue