mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-14 12:15:42 +00:00
13 lines
278 B
TypeScript
13 lines
278 B
TypeScript
|
import {prisma} from '@/lib/prisma'
|
||
|
|
||
|
export async function getViews() {
|
||
|
const totalViews: { _sum: { count: any } } = await prisma.views.aggregate({
|
||
|
_sum: {
|
||
|
count: true
|
||
|
}
|
||
|
})
|
||
|
|
||
|
return {
|
||
|
views: totalViews._sum.count.toString()
|
||
|
}
|
||
|
}
|