Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node_crisp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web
node_crisp
Commits
52d06a8c
Commit
52d06a8c
authored
Jul 02, 2021
by
Sebastián Long
Browse files
Options
Browse Files
Download
Plain Diff
Finish guardar-data-usr
parents
01283d87
baa59579
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
crisp.js
crisp.js
+14
-1
handlers.js
handlers.js
+1
-0
No files found.
crisp.js
View file @
52d06a8c
...
...
@@ -60,6 +60,18 @@ async function getUserData(website_id, session_id) {
return
data
;
}
async
function
updateCrispData
(
website_id
,
session_id
,
correo
,
tipo_documento
,
numero_documento
,
fecha_nacimiento
,
sexo
)
{
await
CrispClient
.
websiteConversations
.
updateMeta
(
website_id
,
session_id
,
{
email
:
correo
,
data
:
{
tipo_documento
:
tipo_documento
,
numero_documento
:
numero_documento
,
fecha_nacimiento
:
fecha_nacimiento
,
sexo
:
sexo
,
}
});
}
async
function
updateUserData
(
website_id
,
session_id
,
data
)
{
localData
[
website_id
.
concat
(
session_id
)]
=
data
;
}
...
...
@@ -72,5 +84,6 @@ module.exports =
getSiguientePaso
:
getSiguientePaso
,
setSiguientePaso
:
setSiguientePaso
,
getUserData
:
getUserData
,
updateUserData
:
updateUserData
updateUserData
:
updateUserData
,
updateCrispData
:
updateCrispData
}
\ No newline at end of file
handlers.js
View file @
52d06a8c
...
...
@@ -418,6 +418,7 @@ module.exports =
},
resp_correo
:
async
function
(
message
,
userData
,
website_id
,
session_id
){
userData
[
CORREO
]
=
message
.
content
;
await
crisp
.
updateCrispData
(
website_id
,
session_id
,
userData
[
CORREO
],
userData
[
TIPO_DOCUMENTO
],
userData
[
NUMERO_DOCUMENTO
],
userData
[
FECHA_NACIMIENTO
],
userData
[
SEXO
]);
if
(
!
await
is
.
existeUsuario
(
userData
[
TIPO_DOCUMENTO
],
userData
[
NUMERO_DOCUMENTO
],
userData
[
FECHA_NACIMIENTO
],
userData
[
SEXO
])
===
true
){
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
'No se pudieron validar sus datos. Solicite por favor su acceso por email ingresando al siguiente link'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment