Skip to content

Commit

Permalink
update user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
angelalvaigle committed Dec 10, 2024
1 parent cd79527 commit bb7c129
Show file tree
Hide file tree
Showing 8 changed files with 462 additions and 254 deletions.
20 changes: 20 additions & 0 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ app.get('/current-user', async (req, res) => {
}
});

app.patch('/update-user', async (req, res) => {
try {
// Forward the add user request to the user service
const userResponse = await axios.patch(
userServiceUrl + '/update-user',
req.body,
{
headers: {
Authorization: req.headers.authorization,
},
}
);
res.json(userResponse.data);
} catch (error) {
res
.status(error.response.status)
.json({ error: error.response.data.error });
}
});

app.post('/addquestion', async (req, res) => {
try {
// Forward the add question request to the question service
Expand Down
Loading

0 comments on commit bb7c129

Please sign in to comment.