feat: добавил личные уведомления для пользователей
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 26s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 8s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 9s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 26s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 19s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 8s
Реализовал хранение, получение и отметку прочитанными пользовательских уведомлений. Обновил фронтенд для отображения и управления уведомлениями в профиле студента.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Achievement, CoinTransaction, Lecture, Review, User, UserRole } from '@/types'
|
||||
import type { Achievement, CoinTransaction, Lecture, Notification, Review, User, UserRole } from '@/types'
|
||||
import type {
|
||||
AchievementDto,
|
||||
CoinTransactionDto,
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
UserDto,
|
||||
UserStatsDto,
|
||||
UserAchievementDto,
|
||||
UserNotificationDto,
|
||||
} from './types'
|
||||
|
||||
export function mapApiRole(role: string | undefined): UserRole {
|
||||
@@ -127,3 +128,14 @@ export function mapApiCoinTransaction(transaction: CoinTransactionDto): CoinTran
|
||||
type: transaction.amount >= 0 ? 'earned' : 'spent',
|
||||
}
|
||||
}
|
||||
|
||||
export function mapApiNotification(notification: UserNotificationDto): Notification {
|
||||
return {
|
||||
id: String(notification.id),
|
||||
type: notification.type,
|
||||
title: notification.title,
|
||||
body: notification.body,
|
||||
read: notification.isRead,
|
||||
createdAt: notification.createdAt,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user