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) {
}).catch(err => { console.error(err) })
}
// Récupération des infos sur une compo (nom, id, asso)
function getCompoGroupById(chan, id) {
const req = `query {composition(id: ${id}) {id label beginningDate association {id name}}}`
return sendRequest(req, chan).then(body => {
......@@ -80,7 +81,7 @@ function getCompoGroupById(chan, id) {
}).catch(err => { console.error(err) })
}
// Récupération des infos persodepuis l'auth VR
function getMe(chan) {
return getNewTokenIfNecessary(chan).then(chan => {
const options = {
......@@ -92,7 +93,6 @@ function getMe(chan) {
})
}
// Récupération d'un token
function getFirstToken(code, state) {
......@@ -132,7 +132,6 @@ function getFirstToken(code, state) {
})
}
// Récupération d'un nouveau token
function getNewToken(chan) {
......@@ -167,4 +166,13 @@ function getNewTokenIfNecessary(chan) {
}
}
module.exports = { getBirthdays, sendRequest, searchGroups, getGroupById, getCompoGroupById, getMe, getFirstToken, getNewToken };
\ No newline at end of file
module.exports = {
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