fix
This commit is contained in:
parent
c01202ea08
commit
293df3b004
@ -144,13 +144,19 @@ function CampaignPage() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setEditLoading(true);
|
setEditLoading(true);
|
||||||
try {
|
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}`, {
|
const res = await fetch(`/api/mail/campaigns/${editCampaign.id}`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
...(token ? { Authorization: `Bearer ${token}` } : {})
|
||||||
},
|
},
|
||||||
body: JSON.stringify(editCampaign)
|
body: JSON.stringify(campaignData)
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user