fix: hh.ru прячет поле письма за переключателем — клик по vacancy-response-letter-toggle, новый селектор письма и кнопки отправки; фронтенд больше не показывает успех при ok=false
This commit is contained in:
1 parent
bd8d865798
commit
d757d2f8c7
2 files changed
+24
-2
No files matched your search
@@ -677,7 +677,7 @@ async function sendFromModal() {
|
||||
const data = await api(`/api/accounts/${currentAccount}/send-now`, {
|
||||
method: 'POST', body: JSON.stringify({ id: sendModalId, message }),
|
||||
});
|
||||
if (data.screenshot) {
|
||||
if (data.ok && data.screenshot) {
|
||||
showShotModal(sendModalId, data.screenshot, data.note || 'Отклик отправлен', true);
|
||||
sentTexts.add(sendModalId);
|
||||
const v = vacancies.find(x => x.id === sendModalId);
|
||||
@@ -685,6 +685,10 @@ async function sendFromModal() {
|
||||
renderVacancies();
|
||||
renderTexts();
|
||||
closeSendModal();
|
||||
} else if (data.screenshot) {
|
||||
// Бэкенд вернул скриншот, но отклик НЕ отправлен (например, не нашёл поле)
|
||||
showShotModal(sendModalId, data.screenshot, data.note || 'Не удалось отправить отклик', false);
|
||||
btn.disabled = false;
|
||||
} else {
|
||||
note.textContent = data.note || 'Не удалось отправить отклик';
|
||||
btn.disabled = false;
|
||||
@@ -737,13 +741,15 @@ async function sendVacancy(id) {
|
||||
method: 'POST', body: JSON.stringify({ id, message }),
|
||||
});
|
||||
if (note) note.textContent = data.note || '';
|
||||
if (data.screenshot) {
|
||||
if (data.ok && data.screenshot) {
|
||||
showShotModal(id, data.screenshot, data.note || 'Отклик отправлен', true);
|
||||
sentTexts.add(id);
|
||||
const v = vacancies.find(x => x.id === id);
|
||||
if (v) v.responded = true;
|
||||
renderVacancies();
|
||||
renderTexts();
|
||||
} else if (data.screenshot) {
|
||||
showShotModal(id, data.screenshot, data.note || 'Не удалось отправить отклик', false);
|
||||
} else {
|
||||
alert(data.note || 'Не удалось отправить отклик');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user