-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cta): add new call-to-action controllers for managing call to ac…
…tion in dashboard page (#498)
- Loading branch information
1 parent
95ce42d
commit e0e18e5
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import express from 'express'; | ||
import { withUser } from '~/middlewares/auth'; | ||
|
||
import { catchErrors } from '~/middlewares/errors'; | ||
|
||
const callToActionRouter = express.Router(); | ||
|
||
// Easy way to show a call to action in the dashboard. | ||
// If show is true, the call to action will be displayed. | ||
|
||
const callToAction = { | ||
show: true, | ||
title: | ||
'📣\n Un besoin ? Un avis ? Une suggestion ?\n Nous sommes à votre écoute !', | ||
label: 'Ecrivez-nous !', | ||
action: 'FEEDBACK', | ||
}; | ||
|
||
callToActionRouter.get( | ||
'/', | ||
withUser, | ||
catchErrors( | ||
async ( | ||
_req: express.Request, | ||
res: express.Response, | ||
_next: express.NextFunction, | ||
) => { | ||
res.status(200).send({ ok: true, data: callToAction }); | ||
}, | ||
), | ||
); | ||
|
||
export default callToActionRouter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters