fix: send FCM token to User/SetFCMToken endpoint
All checks were successful
Build frontend / build (push) Successful in 43s

This commit is contained in:
Claw AI
2026-03-31 21:24:43 +00:00
parent 9e87aa90e8
commit a824fb0c7c

View File

@ -50,13 +50,13 @@ export async function requestNotificationPermission() {
const authToken = localStorage.getItem("auth_token"); const authToken = localStorage.getItem("auth_token");
if (authToken) { if (authToken) {
const apiBase = process.env.NEXT_PUBLIC_API_URL || "http://45.93.137.91/api"; const apiBase = process.env.NEXT_PUBLIC_API_URL || "http://45.93.137.91/api";
await fetch(`${apiBase}/Notifications/RegisterWebToken`, { await fetch(`${apiBase}/User/SetFCMToken`, {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
Authorization: `Bearer ${authToken}`, Authorization: `Bearer ${authToken}`,
}, },
body: JSON.stringify({ token }), body: JSON.stringify({ token, deviceType: 2 }), // 2 = Web
}); });
console.log("[FCM] Token sent to backend"); console.log("[FCM] Token sent to backend");
} }