feat: Enhance server security and performance by adding helmet for security headers, implementing rate limiting, and centralizing error handling; update frontend API calls to use a dedicated api module for consistency
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 4m37s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 4m37s
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import axios from 'axios';
|
||||
import api from './lib/api.js';
|
||||
import {
|
||||
IconPlus,
|
||||
IconSearch,
|
||||
@@ -44,7 +44,7 @@ function DataManager({ entityName, entityKey, placeholder }) {
|
||||
const fetchItems = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/${entityKey}`);
|
||||
const response = await api.get(`/${entityKey}`);
|
||||
setItems(response.data);
|
||||
setError('');
|
||||
} catch (error) {
|
||||
@@ -102,7 +102,7 @@ function DataManager({ entityName, entityKey, placeholder }) {
|
||||
const handleSaveChanges = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
await axios.post(`${API_URL}/${entityKey}`, { domains: items });
|
||||
await api.post(`/${entityKey}`, { domains: items });
|
||||
setSuccess('Изменения успешно сохранены!');
|
||||
setTimeout(() => setSuccess(''), 3000);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user