Skip to content

Commit

Permalink
fix: update query links in hobbiesApi
Browse files Browse the repository at this point in the history
  • Loading branch information
martapanc committed Aug 23, 2023
1 parent 9d9e0c3 commit ee6c622
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 { booksQuery } from '@/queries/books';
import { podcastsQuery } from '@/queries/podcasts';
import { tvSeriesQuery } from '@/queries/tv-series';
import { videoGamesQuery } from '@/queries/video-games';
import { booksQueryQL } from '@/queries/books';
import { podcastsQueryQL } from '@/queries/podcasts';
import { tvShowsQueryQL } from '@/queries/tv-shows';
import { videoGamesQueryQL } from '@/queries/video-games';
import { Book } from '@/sanityTypes/Book';
import { Podcast } from '@/sanityTypes/Podcast';
import { TvShow } from '@/sanityTypes/TvSeries';
Expand All @@ -12,18 +12,18 @@ import { VideoGame } from '@/sanityTypes/VideoGame';
import { sanityClient } from '../../../sanity/lib/client';

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

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

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

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

res.status(200).json({
books,
podcasts,
tvSeries,
tvShows,
videoGames,
});
};
Expand Down

0 comments on commit ee6c622

Please sign in to comment.