Skip to content

Commit 81e7266

Browse files
committed
udpates
1 parent f4c9e3b commit 81e7266

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

app/controllers/wikis.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = {
1717
try {
1818
if (!accessToken) {
1919
const Org = await Organization.find({}).lean().exec()
20-
console.log(Org[0])
2120
if (Org[0].wikis.accessToken) {
2221
accessToken = Org[0].wikis.accessToken
2322
}
@@ -38,7 +37,6 @@ module.exports = {
3837
if (!ref) {
3938
ref = 'master'
4039
}
41-
console.log(title)
4240
res.status(HttpStatus.OK).json({ wikis: await addPageToIndex(await fetchPagesIndex(), title, ref) })
4341
} catch (err) {
4442
res.status(HttpStatus.BAD_REQUEST).json({ Error: err.message })
@@ -61,7 +59,6 @@ module.exports = {
6159
},
6260

6361
deletePage: async (req, res, next) => {
64-
console.log(getOrgId())
6562
const { title } = req.body
6663
try {
6764
const data = {
@@ -95,7 +92,6 @@ module.exports = {
9592
},
9693

9794
oauthCheck: async (req, res, next) => {
98-
console.log(accessToken)
9995
if (!accessToken) {
10096
console.log('redirected to github auth')
10197
res.status(HttpStatus.OK).json({

app/utils/wikis-helper.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = {
2323
fetchPage: async (pageName, ref = 'master') => {
2424
try {
2525
const isPresentInCache = await redisClient.exists(`${pageName}-${ref}`)
26-
console.log(`key exsits in redis = ${!!isPresentInCache}`)
2726
if (isPresentInCache) {
2827
return base64.decode(await redisClient.get(`${pageName}-${ref}`))
2928
}
@@ -39,7 +38,6 @@ module.exports = {
3938
const pageKeys = await redisClient.keys('*')
4039
pageKeys.forEach(async (key) => {
4140
if (key.substring(0, key.indexOf('-')) === pageName) {
42-
console.log(key)
4341
await redisClient.del(key)
4442
}
4543
})
@@ -62,7 +60,7 @@ module.exports = {
6260
return JSON.parse(await redisClient.get(`${pageName}-history`))
6361
},
6462

65-
updatePagesIndex: async () => { // will run when page is deleted, new page is created
63+
updatePagesIndex: async () => {
6664
const newIndex = [{ title: '_Sidebar', content: await module.exports.fetchPage('_Sidebar') }, { title: 'Home' }]
6765
const pages = (await axios.get(`${githubAPI}/repos/${orgId}/Donut-wikis-backup/contents`, opts)).data
6866
pages.forEach(ele => {
@@ -113,7 +111,6 @@ module.exports = {
113111
}
114112
try {
115113
const commit = (await axios.put(`${githubAPI}/repos/${orgId}/Donut-wikis-backup/contents/${fileName}.md`, data, opts)).data.commit.sha
116-
console.log(commit)
117114
if (newFile) {
118115
// open an issue
119116
data = { title: fileName, body: 'Issue opened by Donut to keep track of commits affecting this file.' }
@@ -139,7 +136,6 @@ module.exports = {
139136
- [$Home$]
140137
`
141138
if ((await module.exports.getAllRepos()).filter(repo => repo.name === 'Donut-wikis-backup').length) {
142-
console.log('Repository of the name Donut-wikis-backup already exists')
143139
return 'ALREADY_EXISTS'
144140
} else {
145141
const data = { name: 'Donut-wikis-backup', private: false, description: 'Super Private Donut repo' }

0 commit comments

Comments
 (0)