Skip to content

Commit

Permalink
lets try again
Browse files Browse the repository at this point in the history
  • Loading branch information
epicdragon44 committed Sep 16, 2023
1 parent d208395 commit f733c3e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Simple serverless Slack bot for DTI Coffee Chats and Birthday messages!

Should pair up people in the `#coffee-chats` channel every week.

## Functionality

If you're a regular member, you should only be able to login, edit your own birthday, or report on whether the bot is up or down.

If you're an admin, you should be able to login, edit your own birthday, edit other people's birthdays, toggle the bot on or off, and also manually initiate a new semester, or trigger a round of coffee chats or birthday wishes as needed.

## New to Internbot?

If you're a new Lead, make a PR to add yourself to the array of admins in `lib/data/admins.ts` and merge it in. Then, login with Google and you should have access to the admin panel!

If you're a regular member, just login with Google.

For **everyone**, please login with your Cornell email.

## Technology

Built with Vercel, PostgreSQL, Prisma, Next.js, Jest, and TypeScript.
Expand Down
9 changes: 2 additions & 7 deletions app/(controls)/@gated/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ToggleBot from "@/components/actions/toggle-bot";
import InitSem from "@/components/actions/init-sem";
import ManualTriggers from "@/components/actions/manual-triggers";
import SetSomeonesBday from "@/components/actions/set-someones-bday";
import admins from "@/lib/data/admins";

const GatedActions = async () => {
const hasAccess = await getHasDashboardAccess();
Expand Down Expand Up @@ -32,13 +33,7 @@ const GatedActions = async () => {

const getHasDashboardAccess = async () => {
const checkIfUserHasAccess = async (email: string) =>
(await prisma.user.findFirst({
where: {
email: email,
},
}))
? true
: false;
admins.some((admin) => admin.email === email);

const emails = (await currentUser())?.emailAddresses;

Expand Down
33 changes: 33 additions & 0 deletions lib/data/admins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type admin = {
name?: string;
email: string;
};

const admins: admin[] = [
{
name: "Daniel Wei",
email: "dlw266@cornell.edu",
},
{
name: "Justin Kong",
email: "jk2338@cornell.edu",
},
{
name: "Julie Jeong",
email: "sj598@cornell.edu",
},
{
name: "Rohan Maheshwari",
email: "rm697@cornell.edu",
},
{
name: "Sarah Young",
email: "sy398@cornell.edu",
},
{
name: "Michelle Li",
email: "myl39@cornell.edu",
},
];

export default admins;

0 comments on commit f733c3e

Please sign in to comment.