Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/handler/deleteSponsor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { APIGatewayProxyHandler } from 'aws-lambda';

export const deleteSponsor: APIGatewayProxyHandler = async (event) => {
// Logic to delete a sponsor goes here
// This is a placeholder implementation and may need to be updated based on your specific use case
let sponsorId = event.pathParameters?.sponsorId;
if (!sponsorId) {
return {
statusCode: 400,
body: JSON.stringify({ message: 'sponsorId is required' }),
};
}

// Assume deleteSponsor is a function that deletes a sponsor by ID
await deleteSponsor(sponsorId);

return {
statusCode: 200,
body: JSON.stringify({ message: 'Sponsor deleted successfully' }),
};
};
3 changes: 3 additions & 0 deletions src/handler/sponsors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { generateResponse, generateResponseForError } from '../utils/responseUti
import log from 'lambda-log';
import { SponsorService } from '../service/sponsorService';
import { LambdaError } from "../types/index";
import { deleteSponsor } from './deleteSponsor';

const sponsorService: SponsorService = new SponsorService();

Expand All @@ -15,3 +16,5 @@ export const handler = async (event: APIGatewayProxyEvent): Promise<APIGatewayPr
return generateResponseForError(err as LambdaError);
}
};

export { deleteSponsor };