Untitled

 avatar
unknown
plain_text
a year ago
613 B
3
Indexable
export const updateDifficulties = createAsyncThunk(
  'trainingSession/updateDifficulties',
  async ({ deckId, updatedDifficulties }) => {
    const userId = localStorage.getItem('id');
    if (userId) {
      const response = await axios.patch(
        `${import.meta.env.VITE_API_URL}/account/${userId}/decks/${deckId}/cards/update-difficulties`,
        updatedDifficulties,
        {
          headers: {
            authorization: localStorage.getItem('accessToken'),
          },
        }
      );
      return response.data;
    } else {
      console.log('updatedCard is null or undefined');
    }
  }
);
Editor is loading...
Leave a Comment