diff --git a/app/react/V2/api/translations/index.ts b/app/react/V2/api/translations/index.ts index 7726905f8a..adc1998eb5 100644 --- a/app/react/V2/api/translations/index.ts +++ b/app/react/V2/api/translations/index.ts @@ -2,6 +2,7 @@ import { Params } from 'react-router-dom'; import { IncomingHttpHeaders } from 'http'; import api from 'app/utils/api'; import { I18NApi } from 'app/I18N'; +import { FetchResponseError } from 'shared/JSONRequest'; import { ClientTranslationSchema, ClientTranslationContextSchema } from 'app/istore'; import { RequestParams } from 'app/utils/RequestParams'; import { TranslationValue } from 'V2/shared/types'; @@ -53,7 +54,7 @@ const postV2 = async ( updatedTranslations: TranslationValue[], context: ClientTranslationContextSchema, headers?: IncomingHttpHeaders -): Promise => { +): Promise => { try { const translations = updatedTranslations.map(ut => ({ ...ut, @@ -61,7 +62,7 @@ const postV2 = async ( })); const params = new RequestParams(translations, headers); const response = await api.post('translationsV2', params); - return response.status.ok; + return response.status; } catch (e) { return e; }