feat: more progress

This commit is contained in:
TrèsAbhi committed 2024-09-07 23:19:12 -05:00
1 parent f30e9f810e
commit 636c54aa36
7 files changed
+18 -8

No files matched your search

+1
View File
@@ -1,6 +1,7 @@
{
"name": "@blitzkit/api",
"private": true,
"main": "src/index.ts",
"scripts": {
"dev": "next dev",
"build": "next build"
@@ -1,17 +1,11 @@
import { tankDefinitions, usersDatabase } from '@blitzkit/core';
import { NextRequest, NextResponse } from 'next/server';
import { TankVotes } from '../../../../../../core/src/blitzkit/votes';
import { isValidBlitzId } from '../../../../../../website/src/core/blitz/isValidBlitzId';
import {
BlitzkitResponse,
BlitzkitResponseError,
} from '../../../../../../website/src/hooks/useTankVotes';
import { TankVoteCategory } from '../cast/route';
export interface TankVotes {
categories: Record<TankVoteCategory, number | null>;
votes: number;
last_updated?: number;
}
export async function GET(
request: NextRequest,
+1
View File
@@ -31,4 +31,5 @@ export * from './tankIcon';
export * from './tankNames';
export * from './unionBoundingBox';
export * from './uniqueGuns';
export * from './votes';
export * from './youtubers';
+7
View File
@@ -0,0 +1,7 @@
import { TankVoteCategory } from '../../../api/src/app/tank-voting/[id]/cast/route';
export interface TankVotes {
categories: Record<TankVoteCategory, number | null>;
votes: number;
last_updated?: number;
}
@@ -0,0 +1,5 @@
import { PROVIDERS } from './page';
export async function generateStaticParams() {
return PROVIDERS.map((provider) => ({ provider }));
}
@@ -6,6 +6,8 @@ import { useEffect } from 'react';
import PageWrapper from '../../../components/PageWrapper';
import * as App from '../../../stores/app';
export const PROVIDERS = ['wargaming', 'patreon'];
export interface PatreonAuthResponse {
access_token: string;
expires_in: number;
+1 -1
View File
@@ -1,5 +1,5 @@
import { TankVotes } from '@blitzkit/core';
import { useEffect, useState } from 'react';
import { TankVotes } from '../app/api/tank-voting/[id]/average/route';
import { unwrapBlitzkitResponse } from '../core/blitzkit/unwrapBlitzkitResponse';
import * as App from '../stores/app';