feat: add the view graph on tiktok
This commit is contained in:
@@ -77,6 +77,7 @@ export async function GET(req: NextRequest) {
|
||||
followers: true,
|
||||
likes: true,
|
||||
videoCount: true,
|
||||
views: true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -88,7 +89,7 @@ export async function POST(req: NextRequest) {
|
||||
if (!userId) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
|
||||
const body = await req.json();
|
||||
const { followers, likes, videoCount, displayName, openId } = body;
|
||||
const { followers, likes, videoCount, views, displayName, openId } = body;
|
||||
|
||||
if (followers === undefined) {
|
||||
return NextResponse.json({ error: "Champ 'followers' requis" }, { status: 400 });
|
||||
@@ -115,7 +116,7 @@ export async function POST(req: NextRequest) {
|
||||
followers: followers ?? 0,
|
||||
likes: likes ?? 0,
|
||||
videoCount: videoCount ?? 0,
|
||||
views: 0,
|
||||
views: views ?? 0,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user