Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 - created user table #16

Merged
merged 6 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
Loading