Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-user
Commits
39cdce40
Unverified
Commit
39cdce40
authored
2 years ago
by
sarojsingh2021
Committed by
GitHub
2 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #8 from UPHRH-platform/delete-user-fix
fix-user-delete
parents
f60dea03
b453289d
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/tarento/retail/controller/UserController.java
+2
-6
...in/java/com/tarento/retail/controller/UserController.java
src/main/java/com/tarento/retail/util/Sql.java
+1
-1
src/main/java/com/tarento/retail/util/Sql.java
with
3 additions
and
7 deletions
+3
-7
src/main/java/com/tarento/retail/controller/UserController.java
+
2
−
6
View file @
39cdce40
...
...
@@ -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"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/util/Sql.java
+
1
−
1
View file @
39cdce40
...
...
@@ -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=?"
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets