Skip to content

Commit

Permalink
Merge pull request #16 from ctc-uci/9-create-user-table
Browse files Browse the repository at this point in the history
9 - created user table
  • Loading branch information
ThatMegamind authored Nov 22, 2023
2 parents 80ac134 + f810b9d commit fe99a58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI

on:
[pull_request]

permissions: read-all

jobs:
eslint:
eslint:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
Expand All @@ -21,7 +21,7 @@ jobs:
reporter: github-pr-review
fail_on_error: false
eslint_flags: '**/*.{js,jsx}'

detect-secrets:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scripts/reviewReviewed.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const messageAssignee = async ({ context }) => {
try {
const UserModel = getUserModel();
const slackAssignees = await Promise.allSettled(
githubAssignees.map(assignee => UserModel.findOne({ github: assignee.login })),
githubAssignees.map((assignee) => UserModel.findOne({ github: assignee.login })),
);
if (context.payload.review.state === 'approved') {
await Promise.all(
slackAssignees.map(assignee =>
slackAssignees.map((assignee) =>
Bot.client.chat.postMessage({
channel: assignee.value?.slackId,
text: `One of your pull requests has been APPROVED by ${reviewer}! <${url}|View Review> :shrek::thumbsup:`,
Expand All @@ -53,7 +53,7 @@ const messageAssignee = async ({ context }) => {
);
} else {
await Promise.all(
slackAssignees.map(assignee =>
slackAssignees.map((assignee) =>
Bot.client.chat.postMessage({
channel: assignee.value?.slackId,
text: `One of your pull requests has been REVIEWED by ${reviewer}! <${url}|View Review> :shrek:`,
Expand Down
10 changes: 10 additions & 0 deletions server/schema/users.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TYPE account_type as ENUM ('superadmin', 'admin');

DROP TABLE IF EXISTS users;

CREATE TABLE users (
id VARCHAR ( 256 ) PRIMARY KEY,
email VARCHAR ( 50 ) NOT NULL,
type account_type NOT NULL,
approved BOOLEAN NOT NULL
);

0 comments on commit fe99a58

Please sign in to comment.