-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e710ebd
commit 815efb2
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ jobs: | |
npm install | ||
npm run build | ||
env: | ||
REACT_APP_BACKEND_URL: ${{ secrets.REACT_APP_BACKEND_URL }} | ||
REACT_APP_BACKEND_URL: ${{ secrets.REACT_APP_BACKEND_URL }} | ||
REACT_APP_SHEETS_API_KEY: ${{ secrets.REACT_APP_SHEETS_API_KEY }} | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
class SpreadSheetApi { | ||
async getWorkSheetData(workSheetId) { | ||
const url = `https://spreadsheets.google.com/feeds/list/${workSheetId}/od6/public/values?alt=json`; | ||
const url = `https://sheets.googleapis.com/v4/spreadsheets/${workSheetId}/values/Sheet1?key=${process.env.REACT_APP_SHEETS_API_KEY}`; | ||
const data = await (await fetch(url)).json(); | ||
const keys = data.values.shift(); | ||
|
||
return data.feed.entry.map(entry => { | ||
let obj={}; | ||
Object.keys(entry) | ||
.filter(key => key.startsWith('gsx$')) | ||
.forEach(key => { | ||
obj[key.replace('gsx$','')]=entry[key]['$t']; | ||
}) | ||
return data.values.map(entry => { | ||
let obj = {}; | ||
entry.forEach((item, j) => { | ||
obj[keys[j]] = item; | ||
}); | ||
return obj; | ||
}); | ||
} | ||
} | ||
|
||
var instance = new SpreadSheetApi(); | ||
export default instance; | ||
export default instance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export const membersWorkSheetId = '1lGGGhwkitKwHqFijYE8bbMv4WF8d-8-GgqJN1N8JlyI'; | ||
export const eventsWorkSheetId = '13n5gxO8RXD3mSjoa93UnOx_YOaCLAqBFTFjoy256WgY'; | ||
export const membersWorkSheetId = '1GZq0CoE1AiRlOTYj0fAkUFVtvckLjkE4ggVIW1LwHHo'; | ||
export const eventsWorkSheetId = '1GhmmeCZQYMlsJuA8ydMNoNNEloSI4ete9juk89RKXzg'; | ||
export const timelineWorkSheetId = '1ccSHjT7jpYFY1mvBzwpAbr9XJwuLKwX51k7eQ3K1PSk'; | ||
export const profileImagesRepositoryURL = 'https://raw.githubusercontent.com/WebClub-NITK/Profile-Photos/main/Web%20Club%20Members%20Profile%20Photos/'; |