feat: new nav
This commit is contained in:
1 parent
5733bc0af0
commit
750d5b12c8
25 files changed
+386
-325
No files matched your search
+4
-3
@@ -1,5 +1,5 @@
|
||||
class Server {
|
||||
get<T>(url: string, {params}: { params?: Record<string, unknown> } = {}): Promise<T> {
|
||||
get<T>(url: string, { params }: { params?: Record<string, unknown> } = {}): Promise<T> {
|
||||
const base = 'https://api.themoviedb.org/3';
|
||||
|
||||
const serializedParams = Object.entries(params || {}).reduce((params, [key, value]) => {
|
||||
@@ -11,10 +11,11 @@ class Server {
|
||||
|
||||
return fetch(`${base}${url}?${serializedParams}`, {
|
||||
cache: 'force-cache',
|
||||
next: { revalidate: 3600 },
|
||||
headers: {
|
||||
Authorization: `Bearer ${process.env.MOVIE_DB_TOKEN}`,
|
||||
Authorization: `Bearer ${process.env.MOVIE_DB_TOKEN}`
|
||||
}
|
||||
}).then(response => response.json());
|
||||
}).then((response) => response.json());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user