-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Migration * Work on seeding DB * I think team/event linking working * Finished seeding function for teams/events * Applied linting * fix prisma datatype * Event improvement * Added basic utils page to trigger Seeding * Added prisma migrate github action * Testing * Formatting * Fixed lodash types --------- Co-authored-by: Adam Garcia <[email protected]> Co-authored-by: warren yun <[email protected]>
- Loading branch information
1 parent
0b5e625
commit d8a9f9e
Showing
16 changed files
with
604 additions
and
63 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Prisma Migrate | ||
# https://blog.henriktech.com/deploying-prisma-migrations-via-github-actions | ||
|
||
on: | ||
push: | ||
branches: [staging] | ||
paths: | ||
- "./prisma/**/*.*" | ||
pull_request: | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
cache: "yarn" | ||
|
||
- name: Install | ||
run: yarn install | ||
- name: Rerun Install | ||
run: yarn install | ||
|
||
generate: | ||
runs-on: ubuntu-latest | ||
|
||
needs: install | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
cache: "yarn" | ||
|
||
- name: Install | ||
run: yarn install | ||
|
||
- run: rm -rf node_modules/.prisma | ||
|
||
- name: Generate Prisma Client | ||
run: npx prisma generate | ||
|
||
# migrate: | ||
# runs-on: ubuntu-latest | ||
|
||
# needs: install | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
# - name: Setup Nodejs | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: 16.x | ||
# cache: "yarn" | ||
|
||
# - name: Install | ||
# run: yarn install | ||
|
||
# - run: rm -rf node_modules/.prisma | ||
|
||
# - name: Deploy Migrations | ||
# run: npx prisma migrate deploy | ||
# env: | ||
# DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }} |
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
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
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
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,15 +1,23 @@ | ||
import { NextApiRequest, NextApiResponse } from "next"; | ||
import { fetchTBA } from "@/lib/fetchTBA"; | ||
import { AxiosResponse } from "axios"; | ||
import db from "@/lib/db"; | ||
|
||
export default async function getEventTeams( | ||
req: NextApiRequest, | ||
res: NextApiResponse | ||
): Promise<void> { | ||
const { event } = req.query; | ||
const data: void | AxiosResponse<any, any> = await fetchTBA( | ||
`event/${event}/teams` | ||
); | ||
|
||
res.status(200).send(data); | ||
const rest = await db.team.findMany({ | ||
where: { | ||
events: { | ||
some: { | ||
key: event as string, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
res.status(200).send(rest); | ||
} |
Oops, something went wrong.
d8a9f9e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web – ./
web-git-staging-scoutmachine.vercel.app
machine.frc6070.ca
web-scoutmachine.vercel.app
scoutmachine.vercel.app