add: api restart wa
This commit is contained in:
@@ -19,7 +19,8 @@ const notificationErrorSparepart = require("./notification_error_sparepart.route
|
||||
const sparepart = require("./sparepart.route")
|
||||
const notificationErrorLog = require("./notification_error_log.route")
|
||||
const notificationErrorUser = require("./notification_error_user.route")
|
||||
const errorCode = require("./error_code.route")
|
||||
const errorCode = require("./error_code.route");
|
||||
const notifikasiWA = require("./notifikasi-wa.route");
|
||||
|
||||
router.use("/auth", auth);
|
||||
router.use("/user", users);
|
||||
@@ -42,5 +43,6 @@ router.use("/sparepart", sparepart)
|
||||
router.use("/notification-log", notificationErrorLog)
|
||||
router.use("/notification-user", notificationErrorUser)
|
||||
router.use("/error-code", errorCode)
|
||||
router.use("/notifikasi-wa", notifikasiWA)
|
||||
|
||||
module.exports = router;
|
||||
|
||||
14
routes/notifikasi-wa.route.js
Normal file
14
routes/notifikasi-wa.route.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const NotifikasiWaService = require('../services/notifikasi-wa.service');
|
||||
|
||||
router.post('/restart-wa', async (req, res) => {
|
||||
try {
|
||||
const result = await NotifikasiWaService.restartWhatsapp();
|
||||
return res.status(200).json(result);
|
||||
} catch (error) {
|
||||
return res.status(500).json(error);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user