Skip to content

Commit

Permalink
feat: disable cache for content endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed May 28, 2024
1 parent 4bd9d32 commit 7a6b16d
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 55 deletions.
6 changes: 0 additions & 6 deletions services/api/anime/getAnimeCharacters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand All @@ -23,10 +22,5 @@ export default async function req({
...props,
path: `/anime/${params?.slug}/characters`,
method: 'get',
config: {
next: {
revalidate: 60,
},
},
});
}
4 changes: 1 addition & 3 deletions services/api/anime/getAnimeGenres.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export default async function req(): Promise<Response> {
path: `/anime/genres`,
method: 'get',
config: {
next: {
revalidate: false,
},
cache: 'force-cache',
},
});
}
6 changes: 0 additions & 6 deletions services/api/anime/getAnimeInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand All @@ -18,10 +17,5 @@ export default async function req({
...props,
path: `/anime/${params?.slug}`,
method: 'get',
config: {
next: {
revalidate: 60,
},
},
});
}
5 changes: 0 additions & 5 deletions services/api/characters/getCharacterAnime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,5 @@ export default async function req({
method: 'get',
page,
size,
config: {
next: {
revalidate: 60,
},
},
});
}
6 changes: 0 additions & 6 deletions services/api/characters/getCharacterInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand All @@ -18,10 +17,5 @@ export default async function req({
...props,
path: `/characters/${params?.slug}`,
method: 'get',
config: {
next: {
revalidate: 60,
},
},
});
}
5 changes: 0 additions & 5 deletions services/api/characters/getCharacters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@ export default async function req({
method: 'post',
page,
size,
config: {
next: {
revalidate: 60,
},
},
});
}
1 change: 1 addition & 0 deletions services/api/fetchRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export async function fetchRequest<TResponse>({
? (params as FormData)
: JSON.stringify(params)
: undefined,
cache: 'no-store',
...config.config,
...myConfig,
headers: {
Expand Down
6 changes: 0 additions & 6 deletions services/api/people/getPeople.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand All @@ -21,10 +20,5 @@ export default async function req({
method: 'post',
page,
size,
config: {
next: {
revalidate: 60,
},
},
});
}
6 changes: 0 additions & 6 deletions services/api/people/getPersonAnime.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand Down Expand Up @@ -30,10 +29,5 @@ export default async function req({
method: 'get',
page,
size,
config: {
next: {
revalidate: 60,
},
},
});
}
6 changes: 0 additions & 6 deletions services/api/people/getPersonCharacters.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand Down Expand Up @@ -28,10 +27,5 @@ export default async function req({
method: 'get',
page,
size,
config: {
next: {
revalidate: 60,
},
},
});
}
6 changes: 0 additions & 6 deletions services/api/people/getPersonInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
BaseFetchRequestProps,
FetchRequestProps,
fetchRequest,
} from '@/services/api/fetchRequest';

Expand All @@ -18,10 +17,5 @@ export default async function req({
...props,
path: `/people/${params?.slug}`,
method: 'get',
config: {
next: {
revalidate: 60,
},
},
});
}

0 comments on commit 7a6b16d

Please sign in to comment.