Skip to content

Commit

Permalink
Archive FA24 and Add Script to Generate JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew032011 committed Dec 23, 2024
1 parent c3892d6 commit 8f07c9e
Show file tree
Hide file tree
Showing 3 changed files with 2,392 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"create-idol-images-pr": "esr scripts/create-idol-images-pr.ts",
"backup-prod-db": "esr scripts/backup-prod-db.ts",
"restore-from-backup": "esr scripts/restore-from-backup.ts",
"shoutout-leaderboard": "esr scripts/shoutout-leaderboard.ts"
"shoutout-leaderboard": "esr scripts/shoutout-leaderboard.ts",
"create-member-archive": "esr scripts/create-member-archive.ts"
},
"license": "AGPL-3.0",
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions backend/scripts/create-member-archive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as fs from 'fs';
import { approvedMemberCollection } from '../src/firebase';

approvedMemberCollection.get().then(async (colRef) => {
const members = await Promise.all(colRef.docs.map((doc) => doc.data()));
fs.writeFileSync('src/members-archive/fa24.json', JSON.stringify({ members }, undefined, 2));
});
Loading

0 comments on commit 8f07c9e

Please sign in to comment.