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,15 +2,15 @@ import { Handler } from '@netlify/functions'
import { api } from "./shared/api"
import { HacktheboxInfo } from '../../src/components/infos/Hackthebox'
const handler: Handler = async (event, context) => {
let hackthebox: {profile: {activity: HacktheboxInfo[]}} = await api<{
const handler: Handler = async () => {
const hackthebox: {profile: {activity: HacktheboxInfo[]}} = await api<{
profile: {
activity: HacktheboxInfo[]
}
}>
(`https://www.hackthebox.com/api/v4/profile/activity/1063999`)
let pwn = hackthebox.profile.activity.find((a: HacktheboxInfo) => a!.object_type === "machine")
const pwn = hackthebox.profile.activity.find((a: HacktheboxInfo) => a!.object_type === "machine")
if (!pwn) {
return {
statusCode: 404,