fix: resolve notification ui bugs, audio playback, and team deletion
- Fixed audio playback by rendering a hidden audio tag to comply with browser policies. - Renamed DELETE /notifications to /notifications/clear-all to prevent route conflicts. - Notifications badge now clears automatically when the tray is opened. - Translated notification types to Portuguese (SUCESSO, AVISO, ERRO, INFO). - Implemented team deletion functionality for Admins.
This commit is contained in:
@@ -71,7 +71,7 @@ export const deleteNotification = async (id: string): Promise<boolean> => {
|
||||
|
||||
export const clearAllNotifications = async (): Promise<boolean> => {
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/notifications`, {
|
||||
const response = await fetch(`${API_URL}/notifications/clear-all`, {
|
||||
method: 'DELETE',
|
||||
headers: getHeaders()
|
||||
});
|
||||
@@ -406,6 +406,19 @@ export const updateTeam = async (id: string, teamData: any): Promise<boolean> =>
|
||||
}
|
||||
};
|
||||
|
||||
export const deleteTeam = async (id: string): Promise<boolean> => {
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/teams/${id}`, {
|
||||
method: 'DELETE',
|
||||
headers: getHeaders()
|
||||
});
|
||||
return response.ok;
|
||||
} catch (error) {
|
||||
console.error("API Error (deleteTeam):", error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
export const createTenant = async (tenantData: any): Promise<{ success: boolean; message?: string }> => {
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/tenants`, {
|
||||
|
||||
Reference in New Issue
Block a user