Skip to content
Snippets Groups Projects
Commit 8557bd62 authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

comment requests.js

parent 49047238
No related branches found
No related tags found
No related merge requests found
...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment