Skip to content

Commit

Permalink
feat: Add SMS notification for waste entry in STS manager controller
Browse files Browse the repository at this point in the history
  • Loading branch information
asfi50 committed May 10, 2024
1 parent 919f7eb commit 0df9097
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions express-server/src/controllers/stsmanager.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import auth from '../utils/auth';
import prisma from '../../prisma/prisma-client';
import { createSTS, updateSTS } from '../services/stsmanager.service';
import { latLonDistance } from '../services/billing.service';
import { sendSMS } from '../services/sms.service';

const router = Router();

Expand Down Expand Up @@ -388,6 +389,7 @@ router.post(
},
});

await sendSMS(wasteEntry.contractor.phone, `Waste of ${wasteEntry.volumeOfWaste} kg added to STS ${stsId}`)
res.status(201).json(wasteEntry);
} catch (error: any) {
res.status(400).json({ message: error.message });
Expand Down

0 comments on commit 0df9097

Please sign in to comment.