Skip to content

Commit

Permalink
Merge pull request #2312 from makeplane/stage-release
Browse files Browse the repository at this point in the history
release: stage release to production
  • Loading branch information
sriramveeraghanta authored Sep 29, 2023
2 parents 8d4ac9b + adf4978 commit f751619
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions web/pages/api/unsplash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@ import type { NextApiRequest, NextApiResponse } from "next";
const unsplashKey = process.env.UNSPLASH_ACCESS_KEY;

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { query, page, per_page = 20 } = req.query;
try {
const { query, page, per_page = 20 } = req.query;

const url = query
? `https://api.unsplash.com/search/photos/?client_id=${unsplashKey}&query=${query}&page=${page}&per_page=${per_page}`
: `https://api.unsplash.com/photos/?client_id=${unsplashKey}&page=${page}&per_page=${per_page}`;
const url = query
? `https://api.unsplash.com/search/photos/?client_id=${unsplashKey}&query=${query}&page=${page}&per_page=${per_page}`
: `https://api.unsplash.com/photos/?client_id=${unsplashKey}&page=${page}&per_page=${per_page}`;

const response = await axios({
method: "GET",
url,
headers: {
"Content-Type": "application/json",
},
});
const response = await axios({
method: "GET",
url,
headers: {
"Content-Type": "application/json",
},
});

res.status(200).json(response);
res.status(200).json(response?.data);
} catch (error) {
res.status(500).json({ message: "Failed to fetch unsplash", error });
}
}

2 comments on commit f751619

@vercel
Copy link

@vercel vercel bot commented on f751619 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane – ./web/

plane-git-master-plane.vercel.app
plane-plane.vercel.app
plane-theta.vercel.app
app.plane.so

@vercel
Copy link

@vercel vercel bot commented on f751619 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-sh – ./space/

plane-sh-plane.vercel.app
plane-deploy.vercel.app
plane.sh
plane-sh-git-master-plane.vercel.app

Please sign in to comment.