This commit is contained in:
Leifer Mendez
2022-11-02 21:10:18 +01:00
parent 33797ce9de
commit 0a9e14c460
5 changed files with 45 additions and 7 deletions

View File

@@ -10,7 +10,7 @@ const { addAnswer } = require('./addAnswer')
* @param {*} message `string | string[]`
* @param {*} options {sensitive:boolean} default
*/
const addKeyword = (message, options) => {
const addKeyword = (keyword, options) => {
/**
* Esta funcion deberia parsear y validar las opciones
* del keyword
@@ -25,13 +25,19 @@ const addKeyword = (message, options) => {
}
const ctxAddKeyword = () => {
const ref = generateRef()
const ref = `key_${generateRef()}`
const options = parseOptions()
const json = [
{
ref,
keyword,
},
]
/**
* Se guarda en db
*/
return { ref, keyword: message, options }
return { ref, keyword, options, json }
}
const ctx = ctxAddKeyword()