dashboard: /op-send returns 200; client relies on SSE for visual update
This commit is contained in:
parent
a478792914
commit
616ca38199
2 changed files with 12 additions and 5 deletions
|
|
@ -1143,14 +1143,15 @@
|
|||
fd.append('body', body);
|
||||
input.disabled = true;
|
||||
try {
|
||||
// /op-send now returns 200 (no more 303-to-/). The SSE channel
|
||||
// carries the resulting MessageEvent → the terminal renders the
|
||||
// sent row + the inbox updates on its own; no /api/state
|
||||
// refetch needed.
|
||||
const resp = await fetch('/op-send', {
|
||||
method: 'POST',
|
||||
body: new URLSearchParams(fd),
|
||||
redirect: 'manual',
|
||||
});
|
||||
const ok = resp.ok || resp.type === 'opaqueredirect'
|
||||
|| (resp.status >= 200 && resp.status < 400);
|
||||
if (!ok) {
|
||||
if (!resp.ok) {
|
||||
flashError(`send failed: http ${resp.status}`);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue