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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user