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