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:
Cauê Faleiros
2026-03-13 15:52:27 -03:00
parent 4b0d84f2a0
commit 750ad525c8
4 changed files with 183 additions and 86 deletions

View File

@@ -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`, {