From 6c5008b3272025d9a74d3e7254e4ec114649fd0a Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Wed, 26 Jun 2024 18:13:55 +0530 Subject: [PATCH] changes --- src/index.js | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/index.js b/src/index.js index d11b3b8a..e9df1586 100644 --- a/src/index.js +++ b/src/index.js @@ -144,12 +144,6 @@ fastify.register(require('point-of-view'), { // * This is for login user as a simply user * - -const axios = require('axios'); - -const FCM_SERVER_KEY = 'AAAAA66BLaA:APA91bHcmbyiNN8hCL-t-M9oH-u7ZMOl74fcImMM2DQZLgdyY98Wu9XxME-CTPcjpjU6Yy48ouxISrOMb9lpa3PJofh8qciUKMNxV2al-bDvGvPP_VVaH0mrTHzR56hdkGy1Zl-0frDO'; - - fastify.post("/api/login", { schema: { description: "This is for Login User", @@ -213,30 +207,6 @@ fastify.post("/api/login", { var stringToJsonObject = JSON.parse(arrayToString); // convert string to json object var c_id = loginObject.user.customerId var profilePicture = await ProfilePicture.findOne({ customerId:c_id}); - const registrationToken = loginObject.user.fcmId - console.log(loginObject.user.fcmId) - // const registrationToken = 'dvbHdP8zTf6fEuOIJVcuUH:APA91bG_h4c68bqGzPoJCQirDQWuo2v7Oc2FrOpf9B4OYFXWTfVrNO-8qwp78xYHzDg9LKvEfWbkLr5B4Nl7w-QIvMjdqxcaQySwx4P1lOxe8tJmf3o2WTQ-vFDbzjnW4_8OP4WIqKXv'; // Retrieve device token from loginObject or database - const title = 'Login Successful'; - const body = 'Welcome to our app!'; - - const notification = { - title: title, - body: body - }; - - const data = { - to: registrationToken, - notification: notification - }; - - const headers = { - 'Authorization': `key=${FCM_SERVER_KEY}`, - 'Content-Type': 'application/json' - }; - - const response = await axios.post('https://fcm.googleapis.com/fcm/send', data, { headers }); - - console.log('FCM response:', response.data); if (!profilePicture) { reply.send({ simplydata: {