mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-31 06:29:51 +01:00
feat: more progress
This commit is contained in:
1 parent
f30e9f810e
commit
636c54aa36
7 files changed
+18
-8
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@blitzkit/api",
|
"name": "@blitzkit/api",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"main": "src/index.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build"
|
"build": "next build"
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
import { tankDefinitions, usersDatabase } from '@blitzkit/core';
|
import { tankDefinitions, usersDatabase } from '@blitzkit/core';
|
||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
import { TankVotes } from '../../../../../../core/src/blitzkit/votes';
|
||||||
import { isValidBlitzId } from '../../../../../../website/src/core/blitz/isValidBlitzId';
|
import { isValidBlitzId } from '../../../../../../website/src/core/blitz/isValidBlitzId';
|
||||||
import {
|
import {
|
||||||
BlitzkitResponse,
|
BlitzkitResponse,
|
||||||
BlitzkitResponseError,
|
BlitzkitResponseError,
|
||||||
} from '../../../../../../website/src/hooks/useTankVotes';
|
} 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(
|
export async function GET(
|
||||||
request: NextRequest,
|
request: NextRequest,
|
||||||
|
|||||||
@@ -31,4 +31,5 @@ export * from './tankIcon';
|
|||||||
export * from './tankNames';
|
export * from './tankNames';
|
||||||
export * from './unionBoundingBox';
|
export * from './unionBoundingBox';
|
||||||
export * from './uniqueGuns';
|
export * from './uniqueGuns';
|
||||||
|
export * from './votes';
|
||||||
export * from './youtubers';
|
export * from './youtubers';
|
||||||
@@ -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 PageWrapper from '../../../components/PageWrapper';
|
||||||
import * as App from '../../../stores/app';
|
import * as App from '../../../stores/app';
|
||||||
|
|
||||||
|
export const PROVIDERS = ['wargaming', 'patreon'];
|
||||||
|
|
||||||
export interface PatreonAuthResponse {
|
export interface PatreonAuthResponse {
|
||||||
access_token: string;
|
access_token: string;
|
||||||
expires_in: number;
|
expires_in: number;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import { TankVotes } from '@blitzkit/core';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { TankVotes } from '../app/api/tank-voting/[id]/average/route';
|
|
||||||
import { unwrapBlitzkitResponse } from '../core/blitzkit/unwrapBlitzkitResponse';
|
import { unwrapBlitzkitResponse } from '../core/blitzkit/unwrapBlitzkitResponse';
|
||||||
import * as App from '../stores/app';
|
import * as App from '../stores/app';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user