Commit b453289d authored by sarojsingh2021's avatar sarojsingh2021
Browse files

fix-user-delete

1 merge request!8fix-user-delete
Showing with 3 additions and 7 deletions
+3 -7
......@@ -502,13 +502,9 @@ public class UserController {
if (result.hasErrors()) {
return ResponseGenerator.failureResponse(HttpStatus.UNPROCESSABLE_ENTITY.toString());
}
Boolean userTokenAvailable = userService.findUserByToken(authToken);
String username = "";
if (userTokenAvailable) {
username = jwtTokenUtil.getUsernameFromToken(authToken);
User user = userService.findOne(username);
return ResponseGenerator.successResponse(userService.softDeleteUser(userDto));
if (userService.softDeleteUser(userDto)) {
return ResponseGenerator.successResponse(true);
}
return ResponseGenerator.failureResponse("Invalid Token");
}
......
......@@ -158,7 +158,7 @@ public interface Sql {
final String FETCH_AUTH_TOKEN_REF = "SELECT id FROM user_authentication WHERE auth_token = ? ";
final String REMOVE_USER_DEVICE_TOKEN = "DELETE from user_device WHERE user_auth_id IN (SELECT id FROM user_authentication WHERE auth_token =?) ";
final String DELETE_USER = "DELETE from user WHERE id=?";
final String SOFT_DELETE_USER = "UPDATE user SET deleted=1 WHERE id= ?";
final String SOFT_DELETE_USER = "UPDATE user SET is_deleted=1, is_active = 0 WHERE id= ?";
final String DELETE_USER_ROLE = "DELETE from user_role where user_id=?";
final String DELETE_COUNTRY_USER = "DELETE from country_user where user_id=?";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment