Skip to content

Commit

Permalink
try to disable cache
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossantos74 committed Sep 2, 2024
1 parent cffee4b commit 3f0ab92
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/app/services/getUserData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { IUserResponse } from "../../../types";
export async function getUserData(email: string): Promise<IUserResponse> {
const params = new URLSearchParams({ email: email })

return await fetch(`/api/user?${params}`)
return await fetch(`/api/user?${params}`, {
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
}
})
.then(async (res) => {
return await res.json()
})
Expand All @@ -12,7 +18,13 @@ export async function getUserData(email: string): Promise<IUserResponse> {


export function getUsers(): Promise<IUserResponse[]> {
return fetch(`/api/users`)
return fetch(`/api/users`, {
headers: {
'Cache-Control': 'no-cache, no-store, must-revalidate',
'Pragma': 'no-cache',
'Expires': '0'
}
})
.then((res) => {
return res.json()
})
Expand Down

0 comments on commit 3f0ab92

Please sign in to comment.