mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
@@ -55,12 +55,18 @@ export interface PromoOfferBroadcastRequest {
|
||||
target?: string
|
||||
user_id?: number
|
||||
telegram_id?: number
|
||||
// Telegram notification options
|
||||
send_notification?: boolean
|
||||
message_text?: string
|
||||
button_text?: string
|
||||
}
|
||||
|
||||
export interface PromoOfferBroadcastResponse {
|
||||
created_offers: number
|
||||
user_ids: number[]
|
||||
target: string | null
|
||||
notifications_sent: number
|
||||
notifications_failed: number
|
||||
}
|
||||
|
||||
export interface PromoOfferTemplate {
|
||||
|
||||
@@ -527,9 +527,18 @@ export default function AdminPromoOffers() {
|
||||
onSuccess: (result) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['admin-promo-logs'] })
|
||||
setShowSendModal(false)
|
||||
|
||||
let message = `Создано предложений: ${result.created_offers}`
|
||||
if (result.notifications_sent > 0 || result.notifications_failed > 0) {
|
||||
message += `\nУведомлений отправлено: ${result.notifications_sent}`
|
||||
if (result.notifications_failed > 0) {
|
||||
message += ` (не доставлено: ${result.notifications_failed})`
|
||||
}
|
||||
}
|
||||
|
||||
setResultModal({
|
||||
title: 'Отправлено!',
|
||||
message: `Промопредложение отправлено ${result.created_offers} пользователям`,
|
||||
message,
|
||||
isSuccess: true,
|
||||
})
|
||||
},
|
||||
@@ -557,6 +566,10 @@ export default function AdminPromoOffers() {
|
||||
test_duration_hours: template.test_duration_hours,
|
||||
test_squad_uuids: template.test_squad_uuids,
|
||||
},
|
||||
// Send Telegram notification with template text
|
||||
send_notification: true,
|
||||
message_text: template.message_text,
|
||||
button_text: template.button_text,
|
||||
}
|
||||
|
||||
if (target) {
|
||||
|
||||
Reference in New Issue
Block a user