Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
happy-botday
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume Vagner
happy-botday
Commits
8557bd62
Commit
8557bd62
authored
6 years ago
by
Guillaume Vagner
Browse files
Options
Downloads
Patches
Plain Diff
comment requests.js
parent
49047238
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
requests.js
+12
-4
12 additions, 4 deletions
requests.js
with
12 additions
and
4 deletions
requests.js
+
12
−
4
View file @
8557bd62
...
@@ -62,6 +62,7 @@ function getGroupById(chan, id) {
...
@@ -62,6 +62,7 @@ function getGroupById(chan, id) {
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
}
}
// Récupération des infos sur une compo (nom, id, asso)
function
getCompoGroupById
(
chan
,
id
)
{
function
getCompoGroupById
(
chan
,
id
)
{
const
req
=
`query {composition(id:
${
id
}
) {id label beginningDate association {id name}}}`
const
req
=
`query {composition(id:
${
id
}
) {id label beginningDate association {id name}}}`
return
sendRequest
(
req
,
chan
).
then
(
body
=>
{
return
sendRequest
(
req
,
chan
).
then
(
body
=>
{
...
@@ -80,7 +81,7 @@ function getCompoGroupById(chan, id) {
...
@@ -80,7 +81,7 @@ function getCompoGroupById(chan, id) {
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
}).
catch
(
err
=>
{
console
.
error
(
err
)
})
}
}
// Récupération des infos persodepuis l'auth VR
function
getMe
(
chan
)
{
function
getMe
(
chan
)
{
return
getNewTokenIfNecessary
(
chan
).
then
(
chan
=>
{
return
getNewTokenIfNecessary
(
chan
).
then
(
chan
=>
{
const
options
=
{
const
options
=
{
...
@@ -92,7 +93,6 @@ function getMe(chan) {
...
@@ -92,7 +93,6 @@ function getMe(chan) {
})
})
}
}
// Récupération d'un token
// Récupération d'un token
function
getFirstToken
(
code
,
state
)
{
function
getFirstToken
(
code
,
state
)
{
...
@@ -132,7 +132,6 @@ function getFirstToken(code, state) {
...
@@ -132,7 +132,6 @@ function getFirstToken(code, state) {
})
})
}
}
// Récupération d'un nouveau token
// Récupération d'un nouveau token
function
getNewToken
(
chan
)
{
function
getNewToken
(
chan
)
{
...
@@ -167,4 +166,13 @@ function getNewTokenIfNecessary(chan) {
...
@@ -167,4 +166,13 @@ function getNewTokenIfNecessary(chan) {
}
}
}
}
module
.
exports
=
{
getBirthdays
,
sendRequest
,
searchGroups
,
getGroupById
,
getCompoGroupById
,
getMe
,
getFirstToken
,
getNewToken
};
module
.
exports
=
{
\ No newline at end of file
getBirthdays
,
sendRequest
,
searchGroups
,
getGroupById
,
getCompoGroupById
,
getMe
,
getFirstToken
,
getNewToken
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment