fix: localize validation and api messages
All checks were successful
CI / Validate frontend and API (push) Successful in 39s
CI / Build and publish Docker images (push) Successful in 22s

This commit is contained in:
Cauê Faleiros
2026-09-08 13:40:38 -03:00
parent 987eb210eb
commit ad736758a7
17 changed files with 97 additions and 82 deletions

View File

@@ -130,7 +130,7 @@ export async function apiRequest<T>(path: string, options: RequestInit = {}): Pr
const body = await response.json().catch(() => ({}));
if (!response.ok) {
throw new ApiError(body.error || 'The request could not be completed', response.status);
throw new ApiError(body.error || 'Não foi possível concluir a solicitação.', response.status);
}
return body as T;
}
@@ -141,7 +141,7 @@ async function uploadRequest<T>(path: string, file: File): Promise<T> {
if (session) headers.set('Authorization', `Bearer ${session.token}`);
const response = await fetch(`${API_URL}${path}`, { method: 'PUT', headers, body: file });
const body = await response.json().catch(() => ({}));
if (!response.ok) throw new ApiError(body.error || 'The video upload could not be completed', response.status);
if (!response.ok) throw new ApiError(body.error || 'Não foi possível concluir o envio do vídeo.', response.status);
return body as T;
}
@@ -151,7 +151,7 @@ async function uploadImageRequest<T>(path: string, file: File): Promise<T> {
if (session) headers.set('Authorization', `Bearer ${session.token}`);
const response = await fetch(`${API_URL}${path}`, { method: 'POST', headers, body: file });
const body = await response.json().catch(() => ({}));
if (!response.ok) throw new ApiError(body.error || 'The cover image could not be uploaded', response.status);
if (!response.ok) throw new ApiError(body.error || 'Não foi possível enviar a imagem de capa.', response.status);
return body as T;
}