Skip to content

Commit

Permalink
Add jsdoc to notificationController.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Sep 24, 2023
1 parent d7264b5 commit c511837
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions api/src/controllers/notificationController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import strings from '../config/app.config'
import Notification from '../models/Notification'
import NotificationCounter from '../models/NotificationCounter'

/**
* Get NotificationCounter by UserID.
*
* @export
* @async
* @param {Request} req
* @param {Response} res
* @returns {unknown}
*/
export async function notificationCounter(req: Request, res: Response) {
const { userId } = req.params
try {
Expand All @@ -22,6 +31,15 @@ export async function notificationCounter(req: Request, res: Response) {
}
}

/**
* Get Notifications by UserID.
*
* @export
* @async
* @param {Request} req
* @param {Response} res
* @returns {unknown}
*/
export async function getNotifications(req: Request, res: Response) {
const { userId: _userId, page: _page, size: _size } = req.params

Expand Down Expand Up @@ -51,6 +69,15 @@ export async function getNotifications(req: Request, res: Response) {
}
}

/**
* Mark Notifications as read.
*
* @export
* @async
* @param {Request} req
* @param {Response} res
* @returns {unknown}
*/
export async function markAsRead(req: Request, res: Response) {
try {
const body: { ids: string[] } = req.body
Expand Down Expand Up @@ -87,6 +114,15 @@ export async function markAsRead(req: Request, res: Response) {
}
}

/**
* Mark Notifications as unread.
*
* @export
* @async
* @param {Request} req
* @param {Response} res
* @returns {unknown}
*/
export async function markAsUnRead(req: Request, res: Response) {
try {
const body: { ids: string[] } = req.body
Expand Down Expand Up @@ -123,6 +159,15 @@ export async function markAsUnRead(req: Request, res: Response) {
}
}

/**
* Delete Notifications.
*
* @export
* @async
* @param {Request} req
* @param {Response} res
* @returns {unknown}
*/
export async function deleteNotifications(req: Request, res: Response) {
try {
const body: { ids: string[] } = req.body
Expand Down

0 comments on commit c511837

Please sign in to comment.