feat: Update serverless configuration and refactor API handlers to improve error handling and response structure
This commit is contained in:
@@ -53,12 +53,14 @@ export const handler = async (event: any): Promise<any> => {
|
||||
);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
statusCode: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(tasksWithDetails),
|
||||
};
|
||||
} catch (error: any) {
|
||||
return {
|
||||
status: 500,
|
||||
statusCode: 500,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({
|
||||
message: `Error retrieving tasks: ${error.message}`,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user