mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
Fix
This commit is contained in:
@@ -6,6 +6,7 @@ async function getDailyStats() {
|
||||
const commands = await DockerCommand.query().where('created_at', '>', new Date().getTime())
|
||||
const {data} = await axios.get('https://wakatime.com/api/v1/users/arthurdanjou/stats/last_7_days')
|
||||
const builds = await DockerBuild.query().where('created_at', '>', new Date().getTime())
|
||||
console.log('daily : ' + data)
|
||||
|
||||
return {
|
||||
development_hours: data.data[0].grand_total.total_seconds / 60 / 60,
|
||||
@@ -18,6 +19,7 @@ async function getWeeklyStats() {
|
||||
const commands = await DockerCommand.query().where('created_at', '>', new Date().getTime() - 1000 * 60 * 60 * 24 * 7)
|
||||
const {data} = await axios.get('https://wakatime.com/api/v1/users/arthurdanjou/stats/last_7_days')
|
||||
const builds = await DockerBuild.query().where('created_at', '>', new Date().getTime() - 1000 * 60 * 60 * 24 * 7)
|
||||
console.log('weekly : ' + data)
|
||||
|
||||
return {
|
||||
development_hours: data.data.total_seconds / 60 / 60,
|
||||
@@ -31,6 +33,7 @@ async function getMonthlyStats() {
|
||||
const commands = await DockerCommand.query().where('created_at', '>', new Date().getMonth() - 1)
|
||||
const {data} = await axios.get('https://wakatime.com/api/v1/users/arthurdanjou/stats/last_30_days')
|
||||
const builds = await DockerBuild.query().where('created_at', '>', new Date().getMonth() - 1)
|
||||
console.log('monthly : ' + data)
|
||||
|
||||
return {
|
||||
development_hours: data.data.total_seconds / 60 / 60,
|
||||
@@ -44,6 +47,7 @@ async function getTotalStats() {
|
||||
const commands = await DockerCommand.query()
|
||||
const {data} = await axios.get('https://wakatime.com/api/v1/users/arthurdanjou/all_time_since_today')
|
||||
const builds = await DockerBuild.query()
|
||||
console.log('total : ' + data)
|
||||
|
||||
return {
|
||||
development_hours: data.data.seconds,
|
||||
@@ -54,6 +58,7 @@ async function getTotalStats() {
|
||||
|
||||
async function getOtherStats() {
|
||||
const {data} = await axios.get('https://wakatime.com/api/v1/users/arthurdanjou/stats/last_year')
|
||||
console.log('other : ' + data)
|
||||
|
||||
return {
|
||||
daily_average: data.data.daily_average / 60 / 60,
|
||||
|
||||
@@ -14,6 +14,7 @@ Route.get('/', async ({response}: HttpContextContract) => {
|
||||
response.status(200).send({
|
||||
domain: BASE_URL,
|
||||
version: "1.0",
|
||||
source: `${BASE_URL}/source`,
|
||||
routes: {
|
||||
deezer_data: `${BASE_URL}/deezer`,
|
||||
stats_data: `${BASE_URL}/stats`,
|
||||
|
||||
Reference in New Issue
Block a user