Skip to content

Commit

Permalink
more linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica2673 committed Apr 4, 2024
1 parent ef3e168 commit be46c54
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions backend/typescript/rest/donationsRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ donationRouter.get("/:id", async (req: any, res: any) => {
// Each donation has 1 cause associated with it, the donation from user will be split before calling this route.
donationRouter.post("/give", async (req: any, res: any) => {
try {
const { user_id, amount, cause_id, is_recurring, confirmation_email_sent } =
const { userId, amount, causeId, isRecurring, confirmationEmailSent } =
req.body;

const newDonation = await donationService.createDonation(
user_id,
userId,
amount,
cause_id,
is_recurring,
confirmation_email_sent,
causeId,
isRecurring,
confirmationEmailSent,
);
res.status(200).json(newDonation);
} catch (error) {
Expand Down
26 changes: 13 additions & 13 deletions backend/typescript/services/implementations/donationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,44 +20,44 @@ class DonationService implements IDonationService {
}
}

async getUserDonation(user_id: string): Promise<Array<DonationDTO>> {
console.log(user_id);
async getUserDonation(userId: string): Promise<Array<DonationDTO>> {

Check failure on line 23 in backend/typescript/services/implementations/donationService.ts

View workflow job for this annotation

GitHub Actions / run-lint

Expected 'this' to be used by class async method 'getUserDonation'

Check failure on line 24 in backend/typescript/services/implementations/donationService.ts

View workflow job for this annotation

GitHub Actions / run-lint

Delete `⏎`
try {
const userDonations = await prisma.donation.findMany({
where: {
user_id,
user_id: userId,
},
});

return userDonations;
} catch (error) {
Logger.error(`Error fetching donation for user ${user_id} = ${error}`);
Logger.error(`Error fetching donation for user ${userId} = ${error}`);
throw error;
}
}

async createDonation(
user_id: string,
userId: string,
amount: number,
cause_id: number,
is_recurring: string,
confirmation_email_sent: boolean,
causeId: number,
isRecurring: string,
confirmationEmailSent: boolean,
): Promise<DonationDTO> {
{
try {
const newDonation = await prisma.donation.create({
data: {
user_id,
user_id: userId,
amount,
donation_date: new Date(),
cause_id,
is_recurring: is_recurring as Recurrence,
confirmation_email_sent,
cause_id: causeId,
is_recurring: isRecurring as Recurrence,
confirmation_email_sent: confirmationEmailSent,
},
});
return newDonation;
} catch (error) {
Logger.error(`Error creating donation for user ${user_id} = ${error}`);
Logger.error(`Error creating donation for user ${userId} = ${error}`);
throw error;
}
}
Expand Down

0 comments on commit be46c54

Please sign in to comment.