diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-27 01:59:14 -0400 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-27 01:59:14 -0400 |
| commit | 7b9a58cac0b59a73562d68540292e89f57bf30cf (patch) | |
| tree | bb4c8344ef0e461e4ab5c7b47ebca904819fcb59 /web/src/app/quotes | |
| parent | 598e23ab48f29e13b490ac15acc6f7bbe3671028 (diff) | |
| download | AleeBot-7b9a58cac0b59a73562d68540292e89f57bf30cf.tar.gz AleeBot-7b9a58cac0b59a73562d68540292e89f57bf30cf.tar.bz2 AleeBot-7b9a58cac0b59a73562d68540292e89f57bf30cf.zip | |
More activities; LLM model now needs .env; No longer need to confirm a pending quote
Diffstat (limited to 'web/src/app/quotes')
| -rw-r--r-- | web/src/app/quotes/page.js | 100 |
1 files changed, 48 insertions, 52 deletions
diff --git a/web/src/app/quotes/page.js b/web/src/app/quotes/page.js index 27ae439..0dde1ec 100644 --- a/web/src/app/quotes/page.js +++ b/web/src/app/quotes/page.js @@ -86,64 +86,60 @@ export default function Quotes() { }; const handleApproveQuote = async (id) => { - if (window.confirm('Are you sure you want to approve this quote?')) { - try { - const response = await fetchWithAuth('/api/quotes/approve', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ id }) - }); - - if (!response.ok) { - throw new Error('Failed to approve quote'); - } - - setMessage({ - type: 'success', - text: 'Quote approved successfully' - }); - - // Refresh quotes - fetchPendingQuotes(); - } catch (err) { - setMessage({ - type: 'error', - text: err.message - }); + try { + const response = await fetchWithAuth('/api/quotes/approve', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ id }) + }); + + if (!response.ok) { + throw new Error('Failed to approve quote'); } + + setMessage({ + type: 'success', + text: 'Quote approved successfully' + }); + + // Refresh quotes + fetchPendingQuotes(); + } catch (err) { + setMessage({ + type: 'error', + text: err.message + }); } }; const handleRejectQuote = async (id) => { - if (window.confirm('Are you sure you want to reject this quote?')) { - try { - const response = await fetchWithAuth('/api/quotes/reject', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ id }) - }); - - if (!response.ok) { - throw new Error('Failed to reject quote'); - } - - setMessage({ - type: 'success', - text: 'Quote rejected successfully' - }); - - // Refresh quotes - fetchPendingQuotes(); - } catch (err) { - setMessage({ - type: 'error', - text: err.message - }); + try { + const response = await fetchWithAuth('/api/quotes/reject', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ id }) + }); + + if (!response.ok) { + throw new Error('Failed to reject quote'); } + + setMessage({ + type: 'success', + text: 'Quote rejected successfully' + }); + + // Refresh quotes + fetchPendingQuotes(); + } catch (err) { + setMessage({ + type: 'error', + text: err.message + }); } }; |
