Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-rest-api-mcafee
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cristian Mauricio Diaz Canales
node-rest-api-mcafee
Commits
31e86b95
Commit
31e86b95
authored
Oct 21, 2020
by
Cristian Mauricio Diaz Canales
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se añade logica para cargar terminos y condiciones
parent
725b997a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
endpoints_modules/endpoints.js
endpoints_modules/endpoints.js
+17
-6
No files found.
endpoints_modules/endpoints.js
View file @
31e86b95
...
@@ -52,29 +52,28 @@ class EndPointContenido {
...
@@ -52,29 +52,28 @@ class EndPointContenido {
jsonResponse
.
codeFacebookPixel
=
campania
[
0
].
cam_pixel_facebook
;
jsonResponse
.
codeFacebookPixel
=
campania
[
0
].
cam_pixel_facebook
;
jsonResponse
.
contenidoHead
=
await
this
.
generateHtmlSection
(
jsonResponse
.
contenidoHead
=
await
this
.
generateHtmlSection
(
campania
,
campania
,
template
,
config
.
get
(
"
constants.HTML_SECTIONS.HEAD
"
),
config
.
get
(
"
constants.HTML_SECTIONS.HEAD
"
),
isMobile
isMobile
);
);
jsonResponse
.
contenidoBody
=
await
this
.
generateHtmlSection
(
jsonResponse
.
contenidoBody
=
await
this
.
generateHtmlSection
(
campania
,
campania
,
template
,
config
.
get
(
"
constants.HTML_SECTIONS.BODY
"
),
config
.
get
(
"
constants.HTML_SECTIONS.BODY
"
),
isMobile
isMobile
);
);
jsonResponse
.
contenidoFooter
=
await
this
.
generateHtmlSection
(
jsonResponse
.
contenidoFooter
=
this
.
generateHtmlSection
(
campania
,
campania
,
template
,
config
.
get
(
"
constants.HTML_SECTIONS.FOOTER
"
),
config
.
get
(
"
constants.HTML_SECTIONS.FOOTER
"
),
isMobile
isMobile
);
);
jsonResponse
.
terminosCondiciones
=
this
.
generateHtmlCondiciones
(
campania
);
res
.
status
(
config
.
get
(
"
constants.HTTP_STATUS_CODE.OK
"
)).
send
(
jsonResponse
);
res
.
status
(
config
.
get
(
"
constants.HTTP_STATUS_CODE.OK
"
)).
send
(
jsonResponse
);
}
}
async
generateHtmlSection
(
campania
,
t
emplate
,
t
ype
,
isMobile
)
{
async
generateHtmlSection
(
campania
,
type
,
isMobile
)
{
let
contenidos
=
await
this
.
getContenido
(
campania
,
type
,
isMobile
,
false
);
let
contenidos
=
await
this
.
getContenido
(
campania
,
type
,
isMobile
,
false
);
let
countContenido
=
await
this
.
getContenido
(
let
countContenido
=
await
this
.
getContenido
(
campania
,
campania
,
...
@@ -120,7 +119,6 @@ class EndPointContenido {
...
@@ -120,7 +119,6 @@ class EndPointContenido {
return
arrayJson
;
return
arrayJson
;
}
}
async
getContenido
(
campania
,
type
,
isMobile
,
isCount
)
{
async
getContenido
(
campania
,
type
,
isMobile
,
isCount
)
{
var
query
=
``
;
var
query
=
``
;
if
(
isCount
)
query
=
query
+
`SELECT count(*) as cantidad FROM campania_contenido `
;
if
(
isCount
)
query
=
query
+
`SELECT count(*) as cantidad FROM campania_contenido `
;
...
@@ -227,6 +225,19 @@ class EndPointContenido {
...
@@ -227,6 +225,19 @@ class EndPointContenido {
return
html
;
return
html
;
}
}
generateHtmlCondiciones
(
campania
){
let
arrayJson
=
[];
let
json
=
{};
let
html
=
`<div id="terminos_
${
campania
.
cam_id
}
" class="gearlabs_terminos">Ver términos y condiciones <a href="
${
campania
.
cam_url_terminos_condiciones_campania
}
">aquí</a></div>`
;
json
.
id
=
campania
.
cam_id
;
json
.
contenido
=
html
;
arrayJson
.
push
(
json
);
return
arrayJson
;
}
async
getCampanias
()
{
async
getCampanias
()
{
let
query
=
`SELECT * FROM campania;`
;
let
query
=
`SELECT * FROM campania;`
;
...
...
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