креативы

This commit is contained in:
Artem Tsyrulnikov
2026-01-03 16:11:05 +03:00
parent 841a8b5aaa
commit c04faf8132
15 changed files with 597 additions and 59 deletions

View File

@@ -30,6 +30,15 @@ async def update_creative(
creative.name = input.name
if input.text:
creative.text = domain.replace_invite_link_with_tag(input.text)
if input.media_data is not None:
domain.validate_media_size(input.media_data)
creative.media_data = input.media_data
if input.media_type is not None:
creative.media_type = input.media_type
if input.media_file_id is not None:
creative.media_file_id = input.media_file_id
if input.buttons is not None:
creative.buttons = [button.model_dump() for button in input.buttons]
if input.status:
creative.status = input.status
@@ -41,6 +50,9 @@ async def update_creative(
id=creative.id,
name=creative.name,
text=creative.text,
media_type=creative.media_type,
media_file_id=creative.media_file_id,
buttons=creative.buttons,
project_id=creative.project_id,
project_channel_title=creative.project.channel.title,
created_at=creative.created_at,