Skip to content

Commit

Permalink
Add some types to things
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-m-2983 committed Jul 14, 2024
1 parent 6766522 commit a8c99a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/app/lib/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,19 @@ export async function exportData(sendQueue: any, clearSendQueue: any) {
modals.close("uploadModal")
});

const getCounts = (sendQueue: any[]) => {
const match = sendQueue.filter(item => item.type == "match");
const pit = sendQueue.filter(item => item.type == "pit");
const note = sendQueue.filter(item => item.type == "note");

return { match: match, pit: pit, note: note };
}

modals.open({
title: "Uploading...",
children: (
<>
<Text>{sendQueue.filter((x:any) => x.type == "match").length} match forms, {sendQueue.filter((x:any) => x.type == "pit").length} pit forms, and {sendQueue.filter((x:any) => x.type == "note").length} notes</Text>
<Text>{getCounts(sendQueue).match} match forms, {getCounts(sendQueue).pit} pit forms, and {getCounts(sendQueue).note} notes</Text>
</>
),
modalId: "uploadModal"
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/tba_api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TurboContext } from "./context";

export const TBA_BASE: string = "https://www.thebluealliance.com/api/v3";
export const TBA_KEY: string = "KYyfzxvdzhHGSE6ENeT6H7sxMJsO7Gzp0BMEi7AE3nTR7pHSsmKOSKAblMInnSfw";
export const TBA_OPTS: any = {
export const TBA_OPTS: RequestInit = {
headers: {
"X-TBA-Auth-Key": TBA_KEY
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function useExportState(close: Function) {
}

function NavButton(props: {
children: any,
children: React.ReactNode,
destination: string,
onClick: Function
}) {
Expand Down

0 comments on commit a8c99a1

Please sign in to comment.