diff --git a/public/js/bucket-single.js b/public/js/bucket-single.js
index 7eda8ab..abca208 100644
--- a/public/js/bucket-single.js
+++ b/public/js/bucket-single.js
@@ -124,7 +124,7 @@ __webpack_require__.r(__webpack_exports__);
getComponent
) {
return template(
- '
state.users.length }>
@@ -92,6 +79,12 @@
import axios from 'axios'
import remove from 'lodash.remove'
+ import * as riot from 'riot'
+ import AppModal from './modal.riot'
+
+ riot.register('app-modal', AppModal)
+ riot.mount('app-modal')
+
/**
*
*
@@ -116,18 +109,33 @@
},
handleDelete(event, user) {
+
event.preventDefault()
- axios.delete('/api/users/' + user._id)
- .then((response) => {
+ const customEvent = new CustomEvent('open', {
+ 'detail': {
+ 'confirm': () => {
+ axios.delete('/api/users/' + user._id)
+ .then((response) => {
+
+ // removing from buckets
+ remove(this.state.users, function(u) {
+ return u._id === user._id
+ })
+
+ this.update()
+ })
+ },
+
+ // @TODO find a better solution to create body text
+ 'body': 'Do you want delete ' + user.email + '?'
+ }
+ });
- // removing from buckets
- remove(this.state.users, function(u) {
- return u._id === user._id
- })
+ this.$('#user-delete-confirm').dispatchEvent(customEvent);
- this.update()
- })
+ /**
+ */
},
/**
diff --git a/src/http/api/users.ts b/src/http/api/users.ts
index 01e177e..96591ed 100644
--- a/src/http/api/users.ts
+++ b/src/http/api/users.ts
@@ -6,7 +6,6 @@ import { uuid } from '../../rules/uuid.ts'
const router = Router()
-
/**
* get all users
*
diff --git a/src/http/auth.ts b/src/http/auth.ts
index 5d575e0..9c427f8 100644
--- a/src/http/auth.ts
+++ b/src/http/auth.ts
@@ -33,7 +33,6 @@ router.post('/', async function(request, response)
result = userRepository.verifyPassword(user, body.password)
if (result) {
-
response.cookie('auth-token', jwt)
}
}