Skip to content

Commit 1b05e36

Browse files
committed
fix: return Responses from Netlify function
1 parent 5d241ba commit 1b05e36

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

netlify/functions/process-new-releases.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export default async function handler() {
1414
(release) => release.version === latestRelease.version,
1515
)
1616
) {
17-
return {
18-
statusCode: 200,
19-
body: JSON.stringify({ message: "Release already analyzed" }),
20-
};
17+
return new Response(JSON.stringify({ message: "Release already analyzed" }), {
18+
status: 200,
19+
headers: { 'Content-Type': 'application/json' },
20+
});
2121
}
2222

2323
const analysis = await analyzeReleaseNotes(
@@ -39,16 +39,16 @@ export default async function handler() {
3939
);
4040
}
4141

42-
return {
43-
statusCode: 200,
44-
body: JSON.stringify({ message: "Release analyzed and stored" }),
45-
};
42+
return new Response(JSON.stringify({ message: "Release analyzed and stored" }), {
43+
status: 200,
44+
headers: { 'Content-Type': 'application/json' },
45+
});
4646
} catch (error) {
4747
console.error("Error in check-nextjs-release function:", error);
48-
return {
49-
statusCode: 500,
50-
body: JSON.stringify({ error: "Internal server error" }),
51-
};
48+
return new Response(JSON.stringify({ error: "Internal server error" }), {
49+
status: 500,
50+
headers: { 'Content-Type': 'application/json' },
51+
});
5252
}
5353
}
5454

0 commit comments

Comments
 (0)