Skip to content

Commit

Permalink
fix: Update preference mutation to use slug instead of preference ID
Browse files Browse the repository at this point in the history
  • Loading branch information
sinatragianpaolo committed Oct 29, 2024
1 parent b268a4f commit 162fba4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/Video/components/tools/ToolsTranslate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
useGetUsersMePreferencesQuery,
useGetVideosByVidQuery,
usePostVideosByVidTranslationMutation,
usePutUsersMePreferencesByPrefidMutation,
usePutUsersMePreferencesBySlugMutation,
} from 'src/features/api';
import { useToolsContext } from './context/ToolsContext';

Expand All @@ -37,7 +37,7 @@ const ToolsTranslate = ({ currentLanguage }: { currentLanguage?: string }) => {
const { addToast } = useToast();
const [requestTranslation, { isLoading }] =
usePostVideosByVidTranslationMutation();
const [updatePreference] = usePutUsersMePreferencesByPrefidMutation();
const [updatePreference] = usePutUsersMePreferencesBySlugMutation();
const allowedLanguages = getAllLanguageTags();

const {
Expand Down Expand Up @@ -134,7 +134,7 @@ const ToolsTranslate = ({ currentLanguage }: { currentLanguage?: string }) => {

if (isLangChecked)
updatePreference({
prefid: languagePreference?.name || '',
slug: languagePreference?.name || '',
body: {
value: internalLanguage,
},
Expand All @@ -156,7 +156,7 @@ const ToolsTranslate = ({ currentLanguage }: { currentLanguage?: string }) => {
{ placement: 'top' }
);
})
.catch((e) => {
.catch((e: string) => {
// eslint-disable-next-line no-console
console.error(e);

Expand Down

0 comments on commit 162fba4

Please sign in to comment.