We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab2a8d4 commit 88497d1Copy full SHA for 88497d1
src/v2/unsplash.js
@@ -6,14 +6,13 @@ const sizes = {
6
};
7
8
export const getUnsplashImage = async (query, quality, ...rest) => {
9
- const [env, ctx] = rest;
+ const [env] = rest;
10
query.set('client_id', env.UNSPLASH_TOKEN);
11
const ref = `?utm_source=${env.UNSPLASH_REFERRAL}&utm_medium=referral`;
12
const size = sizes[quality];
13
const data = await (
14
await fetch(`https://api.unsplash.com/photos/random?${query.toString()}`)
15
).json();
16
- ctx.waitUntil(fetch(`${data.links.download_location}&client_id=${env.UNSPLASH_TOKEN}`)); // api requirement
17
return {
18
blur_hash: data.blur_hash,
19
camera: data.exif.model ?? null,
0 commit comments