Fixed Unsplash Images Being Constant

This commit is contained in:
Ahmad 2024-05-01 16:58:27 -04:00
parent 414b1487da
commit 5001d32257
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
2 changed files with 6 additions and 2 deletions

View file

@ -10,7 +10,11 @@ export async function GET() {
if (result?.response) {
const newImages = result.response as Array<Record<string, any>>;
return new NextResponse(JSON.stringify(newImages), { status: 200 });
const response = new NextResponse(JSON.stringify(newImages), {
status: 200,
});
response.headers.set('Cache-Control', 'no-store');
return response;
} else {
return new NextResponse('Failed to get images', { status: 500 });
}