(req, res)
| 569 | }; |
| 570 | |
| 571 | const postApplicationUserPicture = async (req, res) => { |
| 572 | const { file } = req; |
| 573 | const { id: userId } = req.userData; |
| 574 | const { coordinates } = req.body; |
| 575 | try { |
| 576 | const coordinatesObject = coordinates && JSON.parse(coordinates); |
| 577 | const imageData = await imageService.uploadProfilePicture({ file, userId, coordinates: coordinatesObject }); |
| 578 | return res.status(201).json({ |
| 579 | message: "Application picture uploaded successfully!", |
| 580 | image: imageData, |
| 581 | }); |
| 582 | } catch (error) { |
| 583 | logger.error(`Error while uploading application picture: ${error}`); |
| 584 | return res.boom.badImplementation(INTERNAL_SERVER_ERROR); |
| 585 | } |
| 586 | }; |
| 587 | |
| 588 | /** |
| 589 | * Post user profile picture |
no outgoing calls
no test coverage detected