Compare commits
3 Commits
25c5c1b018
...
77ac771b8f
Author | SHA1 | Date | |
---|---|---|---|
77ac771b8f | |||
3762750968 | |||
a276c24f8f |
@ -125,7 +125,7 @@ public class UserController {
|
|||||||
|
|
||||||
@DeleteMapping("/user/{id}")
|
@DeleteMapping("/user/{id}")
|
||||||
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
|
||||||
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
|
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) || id.equals(authServ.getUserFromToken(token).getRegNo()))
|
||||||
return new UnauthorizedResponse<>(null);
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
User toDelete = userService.getUserById(id);
|
User toDelete = userService.getUserById(id);
|
||||||
|
@ -15,11 +15,10 @@ window.onhashchange = function() {
|
|||||||
const Logged = ref(isLogged());
|
const Logged = ref(isLogged());
|
||||||
|
|
||||||
window.addEventListener('hashchange', () => {
|
window.addEventListener('hashchange', () => {
|
||||||
if((location.hash === "#/home" && prevURL === "#/login") || location.hash === "#/home" && prevURL === "#/profil" && !Logged)){
|
if((location.hash === "#/home" && prevURL === "#/login") || (location.hash === "#/home" && prevURL === "#/profil")){
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
const home=ref(i18n("app.home"))
|
const home=ref(i18n("app.home"))
|
||||||
const notifications=ref(i18n("app.notifications"))
|
const notifications=ref(i18n("app.notifications"))
|
||||||
const settings=ref(i18n("app.settings"))
|
const settings=ref(i18n("app.settings"))
|
||||||
|
@ -56,8 +56,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function unRegister(){
|
async function unRegister(){
|
||||||
await deleteUser(user.regNo);
|
disconnect();
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.href="#/home";
|
||||||
|
}, "500");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user