Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ifro-aqs
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
Alan de Oliveira
ifro-aqs
Commits
5d95b066
Commit
5d95b066
authored
Aug 16, 2018
by
Alan de Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
melhorando as mensagens de resposta
parent
d4d64f04
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
horario.js
functions/horario.js
+21
-3
No files found.
functions/horario.js
View file @
5d95b066
...
...
@@ -33,10 +33,9 @@ function findTurma(curso, ano, turma) {
let
turmas
=
JSON
.
parse
(
req
.
getBody
(
'utf8'
)).
turmas
;
console
.
log
(
`Turmas`
+
JSON
.
stringify
(
turmas
));
turmas
=
turmas
.
filter
(
t
=>
return
turmas
.
filter
(
t
=>
t
.
identificador
.
includes
(
ano
+
turma
.
toUpperCase
()));
return
turmas
[
0
];
}
...
...
@@ -57,8 +56,27 @@ exports.action = (conv) => {
let
params
=
conv
.
parameters
;
console
.
log
(
`parâmatros:
${
JSON
.
stringify
(
params
)}
`
);
const
curso
=
findCurso
(
params
.
curso
);
const
turma
=
findTurma
(
curso
,
params
.
ano
,
params
.
turma
);
if
(
curso
===
undefined
)
{
conv
.
ask
(
'não encontramos o curso informado'
);
return
;
}
const
turmas
=
findTurma
(
curso
,
params
.
ano
,
params
.
turma
);
if
(
turmas
.
length
===
0
)
{
conv
.
ask
(
'Não encontrei a turma informada 🙁'
);
return
;
}
if
(
turmas
.
length
>
1
)
{
conv
.
ask
(
'há mais de uma turma aberta'
);
return
;
}
const
turma
=
turmas
[
0
];
const
horario
=
findHorario
(
turma
);
//Gerando mensagens
...
...
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