Fix connection
This commit is contained in:
1 parent
4ad665cac0
commit
b8a847c210
12 files changed
+56
-18
No files matched your search
@@ -12,7 +12,7 @@ export default function SettingsModal({ onClose }: { onClose: () => void }) {
|
||||
const [saved, setSaved] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetch('http://localhost:3001/api/settings', {
|
||||
fetch(`${import.meta.env.VITE_API_URL || 'http://localhost:3001'}/api/settings`, {
|
||||
credentials: 'include'
|
||||
})
|
||||
.then(res => res.json())
|
||||
@@ -33,7 +33,7 @@ export default function SettingsModal({ onClose }: { onClose: () => void }) {
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
await fetch('http://localhost:3001/api/settings', {
|
||||
await fetch(`${import.meta.env.VITE_API_URL || 'http://localhost:3001'}/api/settings`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
Reference in new issue
Block a user