Skip to content

Commit

Permalink
refactor: Update Next.js API endpoint functions to include request ob…
Browse files Browse the repository at this point in the history
…ject with _
  • Loading branch information
lucasm committed Aug 19, 2024
1 parent bba1b7c commit eeac279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pages/api/trends/code.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { NextApiResponse } from 'next'
import type { NextApiRequest, NextApiResponse } from 'next'
import axios from 'axios'
import { ITrends } from '../../../interfaces/trends'

export default async function endpoint(res: NextApiResponse): Promise<void> {
export default async function endpoint(
_req: NextApiRequest,
res: NextApiResponse,
): Promise<void> {
const url = 'https://api.gitterapp.com'

try {
Expand Down
7 changes: 5 additions & 2 deletions pages/api/trends/images.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { NextApiResponse } from 'next'
import type { NextApiRequest, NextApiResponse } from 'next'
import axios from 'axios'
import { ITrends } from '../../../interfaces/trends'

export default async function endpoint(res: NextApiResponse): Promise<void> {
export default async function endpoint(
_req: NextApiRequest,
res: NextApiResponse,
): Promise<void> {
let url =
'https://api.unsplash.com/topics?client_id=' +
process.env.NEXT_PUBLIC_API_UNSPLASH +
Expand Down

0 comments on commit eeac279

Please sign in to comment.