Skip to content

Commit

Permalink
comments order
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichmax committed Feb 23, 2024
1 parent da8791f commit cc6612a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/stats.ts
Expand Up @@ -136,7 +136,7 @@ export default async function handler(
photosCount: photos.length,
commentsCount: comments.data.length,
topicsCount: topics.length,
activitiesCount: activities.data.length || 0,
activitiesCount: 0,
},
})
}
31 changes: 31 additions & 0 deletions pages/stats/index.tsx
Expand Up @@ -21,6 +21,8 @@ import codeStats from "@/src/data/internal/count_total.json"
import SubTitle from "@/components/title/sub-title"
import { useEffect, useState } from "react"
import { fetchGET } from "@/src/utils/fetcher"
import { fetchStrapiAPI } from "@/src/data/external/cms"
import PostPreview from "@/components/article/article-preview/article-preview"

const viewsBarHeight: number = 200

Expand Down Expand Up @@ -379,6 +381,35 @@ export default function Dashboard({
const forkUrl: string = `${githubStats.user.repository.url}/fork`
const starUrl: string = githubStats.user.repository.url

/*const mostViewedPosts = []
function getMostViewedPosts(topPosts) {
async function getPostAttributes(post) {
const postAttributes = await fetchStrapiAPI(
{
filters: {
slug: {
$eq: post.label.replace("/articles/",""),
},
},
fields: [
"title",
"slug",
"updatedAt",
"createdAt",
"description",
],
},
"posts"
)
return postAttributes[0]
}
topPosts.map(post => {
const attributes = getPostAttributes(post)
mostViewedPosts.push(attributes)
})
}*/

const webmentionsCount: number = allWebmentions.length

const linesOfCode: number = codeStats.SUM.code
Expand Down

0 comments on commit cc6612a

Please sign in to comment.