Basic code quality stuff

This commit is contained in:
Taevas 2023-11-05 21:01:24 +01:00
parent 53050c48fb
commit d1c0269a81
18 changed files with 84 additions and 85 deletions

View file

@ -2,8 +2,8 @@ import { Handler } from '@netlify/functions'
import fetch from "node-fetch"
import { GitlabInfo } from '../../src/components/infos/Git'
const handler: Handler = async (event, context) => {
let gitlab = await fetch("https://gitlab.com/api/v4/events?action=pushed", {
const handler: Handler = async () => {
const gitlab = await fetch("https://gitlab.com/api/v4/events?action=pushed", {
method: "GET",
headers: {
"PRIVATE-TOKEN": process.env.API_GITLAB!,
@ -19,8 +19,8 @@ const handler: Handler = async (event, context) => {
}
}
let json = await gitlab.json() as {[key: string]: any}
let activity: GitlabInfo = {
const json = await gitlab.json() as {[key: string]: any}
const activity: GitlabInfo = {
date: json[0].created_at.substring(0, json[0].created_at.indexOf("T"))
}