Skip to content

Commit 3ce1680

Browse files
committed
Bug Fixed
1 parent da5366f commit 3ce1680

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

api/article/controller.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,16 @@ exports.authenticateArticle = asyncHandler(async (req, res, next) => {
170170
});
171171
}
172172
await Article.findByIdAndUpdate(articleId, { isAuthentic: true });
173-
174173
// Notification to Sahara Backend
175174
let notiMessage = '';
176175
try {
177176
const noti_response = await fetch(process.env.NOTIFICATION_URL, {
178177
method: 'POST',
179-
body: articleDetails,
180-
headers: {'Authorization': `Bearer ${process.env.NOTIFICATION_TOKEN}`},
178+
body: JSON.stringify(articleDetails),
179+
headers: {'Content-type': 'application/json' ,'Authorization': `Bearer ${process.env.NOTIFICATION_TOKEN}`},
181180
}
182181
);
183-
// console.log(noti_response);
182+
// console.log(noti_response, articleDetails);
184183
if(noti_response.status===200){
185184
notiMessage = `Notification sent successfully!`;
186185
};

0 commit comments

Comments
 (0)