chore: code cleaning (#21)

This commit is contained in:
Riccardo Senica
2024-11-23 09:13:15 +01:00
committed by GitHub
parent c4f03feffe
commit c300b2501d
31 changed files with 903 additions and 872 deletions

View File

@@ -1,5 +1,5 @@
import prisma from '@prisma/prisma';
import { ApiResponse } from '@utils/apiResponse';
import { formatApiResponse } from '@utils/formatApiResponse';
import {
INTERNAL_SERVER_ERROR,
STATUS_INTERNAL_SERVER_ERROR,
@@ -21,10 +21,13 @@ export async function GET() {
});
if (news) {
return ApiResponse(STATUS_OK, news);
return formatApiResponse(STATUS_OK, news);
}
} catch (error) {
console.error(error);
return ApiResponse(STATUS_INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR);
return formatApiResponse(
STATUS_INTERNAL_SERVER_ERROR,
INTERNAL_SERVER_ERROR
);
}
}