Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
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
Billy Larru
Asistencia
Commits
e728612d
Commit
e728612d
authored
Aug 21, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
formeateando respuesta de axios
parent
8efa7180
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
general.js
src/main/webapp/js/general.js
+9
-0
crearRolPolicia.js
src/main/webapp/js/pages/crearRolPolicia.js
+2
-13
No files found.
src/main/webapp/js/general.js
View file @
e728612d
...
...
@@ -345,4 +345,12 @@ const makeDatatable = (jsonForDatatable = { data: [], columns: [], columnDefs: [
const
randomIntFromInterval
=
(
minimum
,
maximum
)
=>
{
return
Math
.
round
(
Math
.
random
()
*
(
maximum
-
minimum
)
+
minimum
);
}
function
formatResponse
(
resultAxios
)
{
return
{
status
:
resultAxios
.
data
.
status
||
true
,
message
:
resultAxios
.
data
.
message
||
`Operación exitosa`
,
data
:
resultAxios
.
data
.
data
||
result
.
data
};
}
\ No newline at end of file
src/main/webapp/js/pages/crearRolPolicia.js
View file @
e728612d
...
...
@@ -198,7 +198,7 @@ function registrarRolPolicia() {
let
sede_descripcion
=
$
(
"#cboSedesModal option:selected"
).
text
();
let
estado
=
1
;
let
policia_dni
=
$
(
"#cboPolicias option:selected"
).
attr
(
"documento_identidad"
);
debugger
let
fechas
=
generarFechas
(
fecha_inicio
,
fecha_fin
);
let
detalles_rol
=
[];
...
...
@@ -232,18 +232,7 @@ function registrarRolPolicia() {
axios
.
post
(
URI_ROL_POLICIA
,
params
)
.
then
((
result
)
=>
{
debugger
;
function
formatSo
(
resultAxios
)
{
return
{
status
:
resultAxios
.
data
.
status
||
true
,
message
:
resultAxios
.
data
.
message
||
`Operación exitosa`
,
data
:
resultAxios
.
data
.
data
||
result
.
data
};
}
debugger
;
result
.
data
=
formatSo
(
result
);
result
.
data
=
formatResponse
(
result
);
debugger
;
if
(
result
.
data
.
status
)
{
listarRolesPolicias
();
...
...
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