Skip to content

Commit 0a2f778

Browse files
Hayden SmithHayden Smith
authored andcommitted
server fix
1 parent 75e7330 commit 0a2f778

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/src/server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const getForum = shortTermHold('forum', async (term) => {
6868
const getGroups = shortTermHold('groups', async (term) => {
6969
const { stdout } = shell.exec(`rm -rf /tmp/gl && git clone [email protected]:COMP6080/${term}/STAFF/administration.git /tmp/gl && cd /tmp/gl && cat groups.csv`)
7070
const groupLink = {};
71-
raw.split('\n').forEach(line => {
71+
stdout.split('\n').forEach(line => {
7272
const innerLine = line.split(',');
7373
if (innerLine[0] !== 'id' && innerLine[0] !== '') {
7474
const zid = innerLine[0].replace('z', '');
@@ -261,14 +261,15 @@ app.get('/gitlabredir/:term/:repo/:path?', async (req, res) => {
261261
if (isTutor(zid, term)) {
262262
repoPath = `https://nw-syd-gitlab.cseunsw.tech/COMP6080/${term}/STAFF/repos/${newRepo}`
263263
} else if (['ass4'].includes(repo)) {
264-
const group = (await getGroups(term)).groups[zid];
264+
const group = (await getGroups(term))[zid];
265265
repoPath = `https://nw-syd-gitlab.cseunsw.tech/COMP6080/${term}/groups/${group}/${newRepo}`
266266
}
267267
if (path) {
268268
repoPath += `/-/tree/master/${path}`
269269
}
270270
res.redirect(repoPath);
271271
} catch (err) {
272+
console.log('err', err);
272273
res.status(400).send({ err: 'Go away' });
273274
}
274275
});

0 commit comments

Comments
 (0)