Skip to content

Commit

Permalink
fix: fix hobbies api
Browse files Browse the repository at this point in the history
  • Loading branch information
martapanc committed Aug 23, 2023
1 parent 680f814 commit bc31209
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/pages/api/hobbies.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { NextApiRequest, NextApiResponse } from 'next';

import { booksQueryQL } from '@/queries/books';
import { podcastsQueryQL } from '@/queries/podcasts';
import { tvShowsQueryQL } from '@/queries/tv-shows';
import { videoGamesQueryQL } from '@/queries/video-games';
import { booksQuery } from '@/queries/books';
import { podcastsQuery } from '@/queries/podcasts';
import { tvSeriesQuery } from '@/queries/tv-shows';
import { videoGamesQuery } from '@/queries/video-games';
import { Book } from '@/sanityTypes/Book';
import { Podcast } from '@/sanityTypes/Podcast';
import { TvShow } from '@/sanityTypes/TvSeries';
Expand All @@ -12,13 +12,13 @@ import { VideoGame } from '@/sanityTypes/VideoGame';
import { sanityClient } from '../../../sanity/lib/client';

const hobbiesApi = async (req: NextApiRequest, res: NextApiResponse) => {
const books: Book[] = await sanityClient.fetch(booksQueryQL);
const books: Book[] = await sanityClient.fetch(booksQuery);

const podcasts: Podcast[] = await sanityClient.fetch(podcastsQueryQL);
const podcasts: Podcast[] = await sanityClient.fetch(podcastsQuery);

const tvShows: TvShow[] = await sanityClient.fetch(tvShowsQueryQL);
const tvShows: TvShow[] = await sanityClient.fetch(tvSeriesQuery);

const videoGames: VideoGame[] = await sanityClient.fetch(videoGamesQueryQL);
const videoGames: VideoGame[] = await sanityClient.fetch(videoGamesQuery);

res.status(200).json({
books,
Expand Down

0 comments on commit bc31209

Please sign in to comment.