Skip to content

Commit

Permalink
🔊 Add logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieutu committed Aug 28, 2024
1 parent 0139333 commit 6135c9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/api/algolia/structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SysType,
} from '../../../services/contentful'
import { deleteStructure, refreshStructures, saveStructure } from '../../../services/algolia.server'
import { log } from 'console'

Check failure on line 10 in src/pages/api/algolia/structures.ts

View workflow job for this annotation

GitHub Actions / checks

`console` import should occur before import of `../../../services/contentful`

Check failure on line 10 in src/pages/api/algolia/structures.ts

View workflow job for this annotation

GitHub Actions / checks

'log' is defined but never used

const deleteStructureFromAlgolia = async (structureId: string, res: NextApiResponse) => {
console.log(`Deleting structure id ${structureId}`)
Expand Down Expand Up @@ -49,6 +50,8 @@ const refreshStructuresIndex = async (res: NextApiResponse) => {
}

export default async (req: NextApiRequest, res: NextApiResponse) => {
console.log(req)

const body = req.body as { id: string, sysType: SysType, contentType: ContentType }

if (!body.id) return res.status(400).json({ error: 'Missing id in request body' })
Expand Down

0 comments on commit 6135c9d

Please sign in to comment.