Przeglądaj źródła

fix: inconsistent error response in /translations

Sven 2 lat temu
rodzic
commit
2cbe6ff1f0
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/routes/translations.ts

+ 1 - 1
src/routes/translations.ts

@@ -24,7 +24,7 @@ export function initTranslationsRoutes(router: Router) {
 
             const translations = await getTranslations(Number(songId), { preferLang });
 
-            if(!translations)
+            if(!translations || translations.length === 0)
                 return respond(res, "clientError", "Couldn't find translations for this song", format, 0);
 
             return respond(res, "success", { translations }, format, translations.length);