fix: data return format
This commit is contained in:
@@ -3,7 +3,7 @@ import type { NextRequest } from 'next/server';
|
||||
import cors from '@/lib/cors';
|
||||
|
||||
const paths = [
|
||||
{ path: '/total-prs', description: 'Total GitHub Forks' },
|
||||
{ path: '/total-prs', description: 'Total GitHub Merged PRs' },
|
||||
{ path: '/total-stars', description: 'Total GitHub Stars' },
|
||||
{ path: '/total-forks', description: 'Total GitHub Forks' },
|
||||
{ path: '/total-issues', description: 'Total GitHub Issues' },
|
||||
|
||||
@@ -8,7 +8,7 @@ export async function GET(request: Request) {
|
||||
|
||||
return cors(
|
||||
request,
|
||||
new Response(JSON.stringify({ 'total-forks': transformedData }), {
|
||||
new Response(JSON.stringify(transformedData), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
|
||||
@@ -8,7 +8,7 @@ export async function GET(request: Request) {
|
||||
|
||||
return cors(
|
||||
request,
|
||||
new Response(JSON.stringify({ 'total-issues': transformedData }), {
|
||||
new Response(JSON.stringify(transformedData), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
|
||||
@@ -8,7 +8,7 @@ export async function GET(request: Request) {
|
||||
|
||||
return cors(
|
||||
request,
|
||||
new Response(JSON.stringify({ 'total-stars': transformedData }), {
|
||||
new Response(JSON.stringify(transformedData), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
|
||||
@@ -8,7 +8,7 @@ export async function GET(request: Request) {
|
||||
|
||||
return cors(
|
||||
request,
|
||||
new Response(JSON.stringify({ 'total-stars': transformedData }), {
|
||||
new Response(JSON.stringify(transformedData), {
|
||||
status: 200,
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user