MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / postApplicationUserPicture

Function postApplicationUserPicture

controllers/users.js:571–586  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

569};
570
571const 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

Callers 1

handleUserPictureUploadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected