-
Notifications
You must be signed in to change notification settings - Fork 3
dev #32
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
Open
hanaeatsplanes
wants to merge
9
commits into
main
Choose a base branch
from
dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
dev #32
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fc03b64
fix TS71007
hanaeatsplanes 9dc3948
uh
hanaeatsplanes ecb5567
grrr
hanaeatsplanes a621c4f
ship ship ship
hanaeatsplanes 5cdbd52
fix: preserve newlines in project descriptions
hanaeatsplanes 7dac1a2
biome is better i have just decided
hanaeatsplanes ce2405e
asdad (#33)
hanaeatsplanes 56ffbed
uh update
hanaeatsplanes 397a72f
fix merge conflgicht
hanaeatsplanes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,16 +1,15 @@ | ||
| name: tsc | ||
| name: biome | ||
| on: | ||
| - push | ||
| - pull_request | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint | ||
| name: Lint & Format | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| - run: npm install -g yarn # this is necessary for act, also just a good failsafe | ||
| - run: npm install -g yarn | ||
| - run: yarn install | ||
| - run: yarn lint | ||
| - run: yarn tsc --noEmit | ||
| - run: yarn biome:check |
This file contains hidden or 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,20 @@ | ||
| { | ||
| "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
| "organizeImports": { | ||
| "enabled": true | ||
| }, | ||
| "linter": { | ||
| "enabled": true, | ||
| "rules": { | ||
| "recommended": true | ||
| } | ||
| }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "indentStyle": "space", | ||
| "indentWidth": 2 | ||
| }, | ||
| "files": { | ||
| "ignore": [".next", "node_modules", "backend"] | ||
| } | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,27 +1,29 @@ | ||
| import { NextResponse } from "next/server"; | ||
|
|
||
| let cache: { | ||
| hash: string | ||
| message: string | ||
| } | undefined | ||
| let cache: | ||
| | { | ||
| hash: string; | ||
| message: string; | ||
| } | ||
| | undefined; | ||
|
|
||
| export async function GET() { | ||
| if (!cache) { | ||
| const githubRes = await fetch( | ||
| "https://api.github.com/repos/hackclub/aces/commits/main" | ||
| ) | ||
| "https://api.github.com/repos/hackclub/aces/commits/main", | ||
| ); | ||
|
|
||
| if (!githubRes.ok) { | ||
| throw new Error(`GitHub API error: ${githubRes.status}`) | ||
| throw new Error(`GitHub API error: ${githubRes.status}`); | ||
| } | ||
|
|
||
| const json = await githubRes.json() | ||
| const json = await githubRes.json(); | ||
|
|
||
| cache = { | ||
| hash: json.sha.substring(0, 7), | ||
| message: json.commit.message, | ||
| } | ||
| }; | ||
| } | ||
|
|
||
| return NextResponse.json(cache) | ||
| return NextResponse.json(cache); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,19 @@ | ||
| import { NextResponse } from "next/server"; | ||
|
|
||
| // TODO: This is a placeholder implementation. Backend needs to be updated to: | ||
| // 1. Add a ShopConfig model/table to store form URLs and other shop settings | ||
| // 2. Create /api/v1/shop/config endpoint to fetch/update shop configuration | ||
| // 3. This route should then proxy to the backend instead of using env vars | ||
|
|
||
| export async function GET() { | ||
| const formUrl = process.env.NEXT_PUBLIC_SHOP_FORM_URL; | ||
|
|
||
| if (!formUrl) { | ||
| return NextResponse.json( | ||
| { error: "Shop form URL not configured" }, | ||
| { status: 503 }, | ||
| ); | ||
| } | ||
|
|
||
| return NextResponse.json({ formUrl }); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The mutation of the parsed data on lines 16-18 occurs after type assertion but without proper type checking. Since the type annotation on line 10 doesn't provide runtime safety, the check
data.description === ""could fail if description is undefined or missing. Consider restructuring this to avoid mutation and ensure type safety, for example:body: JSON.stringify({ ...data, description: data.description === "" ? null : data.description })