Skip to content

Commit

Permalink
Merge pull request #304 from OfflineHQ/process-loyalty-card-next-resp…
Browse files Browse the repository at this point in the history
…onse

update processLoyaltyCardsMint handler cron so it returns a next reponse
  • Loading branch information
AlexandreG-tech authored May 3, 2024
2 parents 1dc4e11 + f5f9b0b commit d8e2d0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/web/crons/processLoyaltyCardsMint.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { handler as processLoyaltyCardsMintHandler } from '@features/loyalty-card-cron';
import { NextResponse } from 'next/server';

export default async function handler() {
try {
Expand All @@ -7,9 +8,13 @@ export default async function handler() {
'Minting process completed successfully for loyaltyCard:',
result,
);
return result;
return new NextResponse(JSON.stringify(result), {
status: 200,
});
} catch (error) {
console.error('Error during the minting process for loyaltyCard:', error);
throw error; // Re-throw the error if you want to propagate it further or handle it differently.
return new NextResponse(JSON.stringify({ error: error.message }), {
status: 500,
});
}
}

0 comments on commit d8e2d0f

Please sign in to comment.