add controller method for getting status page by url, update delete controlelr method
This commit is contained in:
1 parent
65bc98ca2e
commit
c352ca39b1
1 file changed
+14
-2
@@ -62,7 +62,7 @@ class StatusPageController {
|
|||||||
try {
|
try {
|
||||||
const statusPage = await this.db.getStatusPage();
|
const statusPage = await this.db.getStatusPage();
|
||||||
return res.success({
|
return res.success({
|
||||||
msg: successMessages.STATUS_PAGE_BY_URL,
|
msg: successMessages.STATUS_PAGE,
|
||||||
data: statusPage,
|
data: statusPage,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -70,9 +70,21 @@ class StatusPageController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getStatusPageByUrl = async (req, res, next) => {
|
||||||
|
try {
|
||||||
|
const statusPage = await this.db.getStatusPageByUrl(req.params.url);
|
||||||
|
return res.success({
|
||||||
|
msg: successMessages.STATUS_PAGE_BY_URL,
|
||||||
|
data: statusPage,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
next(handleError(error, SERVICE_NAME, "getStatusPageByUrl"));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
deleteStatusPage = async (req, res, next) => {
|
deleteStatusPage = async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
await this.db.deleteStatusPage();
|
await this.db.deleteStatusPage(req.params.url);
|
||||||
return res.success({
|
return res.success({
|
||||||
msg: successMessages.STATUS_PAGE_DELETE,
|
msg: successMessages.STATUS_PAGE_DELETE,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user