File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -390,13 +390,27 @@ const generateUsername = async (req, res) => {
390390 * @param req {Object} - Express request object
391391 * @param res {Object} - Express response object
392392 */
393-
393+ /**
394+ * @deprecated
395+ * WARNING: This API endpoint is being deprecated and will be removed in future versions.
396+ * Please use the updated API endpoint: `/users?profile=true` for retrieving user profile details.
397+ *
398+ * For more information, refer to this PR:
399+ * https://github.com/Real-Dev-Squad/website-backend/pull/2201
400+ *
401+ * This API is kept temporarily for backward compatibility.
402+ */
394403const getSelfDetails = async ( req , res ) => {
395404 try {
396405 if ( req . userData ) {
397406 const user = await dataAccess . retrieveUsers ( {
398407 userdata : req . userData ,
399408 } ) ;
409+
410+ res . set (
411+ "X-Deprecation-Warning" ,
412+ "WARNING: This endpoint is deprecated and will be removed in the future. Please use /users?profile=true to get the updated profile details."
413+ ) ;
400414 return res . send ( user ) ;
401415 }
402416 return res . boom . notFound ( "User doesn't exist" ) ;
Original file line number Diff line number Diff line change @@ -978,6 +978,11 @@ describe("Users", function () {
978978 expect ( res . body ) . to . not . have . property ( "phone" ) ;
979979 expect ( res . body ) . to . not . have . property ( "email" ) ;
980980 expect ( res . body ) . to . not . have . property ( "chaincode" ) ;
981+ expect ( res ) . to . have . header (
982+ "X-Deprecation-Warning" ,
983+ "WARNING: This endpoint is deprecated and will be removed in the future. Please use /users?profile=true to get the updated profile details."
984+ ) ;
985+
981986 return done ( ) ;
982987 } ) ;
983988 } ) ;
You can’t perform that action at this time.
0 commit comments