Skip to content

Commit

Permalink
Update +server.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ieedan committed Feb 25, 2025
1 parent c7c040f commit 065c976
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sites/docs/src/routes/badges/build/[state]/+server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { error } from '@sveltejs/kit';
import { makeBadge } from 'badge-maker';

export const GET = async ({ params }) => {
let state = params.state;

if (state.endsWith('.svg')) state = state.slice(0, state.length - 4);

if (!['passing', 'failing'].includes(state));
if (!['passing', 'failing'].includes(state)) throw error(404);

const svg = makeBadge({
label: 'jsrepo',
Expand Down

0 comments on commit 065c976

Please sign in to comment.