fix: templateService return format and Templates page array handling

- Updated templateService to return response.data like other services
- Added fallback to empty array in Templates.jsx to prevent map errors
- Ensures consistency across all service modules
This commit is contained in:
salvacybersec
2025-11-10 19:17:13 +03:00
parent aed4f759b3
commit 64c7c392bc
2 changed files with 26 additions and 7 deletions

View File

@@ -63,10 +63,11 @@ function Templates() {
try {
setLoading(true);
const response = await templateService.getAll();
setTemplates(response.data);
setTemplates(response.data || []);
} catch (error) {
console.error('Failed to load templates:', error);
alert('Şablonlar yüklenemedi');
setTemplates([]);
} finally {
setLoading(false);
}