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) => {
390
390
* @param req {Object} - Express request object
391
391
* @param res {Object} - Express response object
392
392
*/
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
+ */
394
403
const getSelfDetails = async ( req , res ) => {
395
404
try {
396
405
if ( req . userData ) {
397
406
const user = await dataAccess . retrieveUsers ( {
398
407
userdata : req . userData ,
399
408
} ) ;
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
+ ) ;
400
414
return res . send ( user ) ;
401
415
}
402
416
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 () {
978
978
expect ( res . body ) . to . not . have . property ( "phone" ) ;
979
979
expect ( res . body ) . to . not . have . property ( "email" ) ;
980
980
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
+
981
986
return done ( ) ;
982
987
} ) ;
983
988
} ) ;
You can’t perform that action at this time.
0 commit comments