Fix github stars endpoint (#5301)
- Encapsulated GitHub star response in an object - Fixed rounding of Github stars to align with Github convention - Fixed CORS issue so that endpoint can be called from twenty.com and app.twenty.com Co-authored-by: Ady Beraud <a.beraud96@gmail.com>
This commit is contained in:
@ -13,11 +13,11 @@ export async function GET() {
|
||||
desc(githubStarsModel.timestamp),
|
||||
);
|
||||
|
||||
const formattedGithubNumberOfStars = formatNumberOfStars(
|
||||
const githubNumberOfStars = formatNumberOfStars(
|
||||
githubStars[0].numberOfStars,
|
||||
);
|
||||
|
||||
return Response.json(formattedGithubNumberOfStars);
|
||||
return Response.json({ githubNumberOfStars });
|
||||
} catch (error: any) {
|
||||
return new Response(`Github stars error: ${error?.message}`, {
|
||||
status: 500,
|
||||
|
||||
Reference in New Issue
Block a user