fix
This commit is contained in:
parent
c01202ea08
commit
293df3b004
@ -144,13 +144,19 @@ function CampaignPage() {
|
||||
e.preventDefault();
|
||||
setEditLoading(true);
|
||||
try {
|
||||
// Извлекаем smtp_server_id из массива SmtpServers
|
||||
const campaignData = { ...editCampaign };
|
||||
if (campaignData.SmtpServers && campaignData.SmtpServers.length > 0) {
|
||||
campaignData.smtp_server_id = campaignData.SmtpServers[0].id;
|
||||
}
|
||||
|
||||
const res = await fetch(`/api/mail/campaigns/${editCampaign.id}`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
||||
},
|
||||
body: JSON.stringify(editCampaign)
|
||||
body: JSON.stringify(campaignData)
|
||||
});
|
||||
if (!res.ok) {
|
||||
const data = await res.json();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user