import { CREATE_REVIEW, FETCH_LAST_REVIEW } from '../constants/review';

export function fetchLastReview(chapterId) {
  return {
    type: FETCH_LAST_REVIEW,
    api: true,
    auth: true,
    payload: {
      method: 'GET',
      url: '/students/reviews/last',
      params: { chapter: chapterId }
    }
  };
}

export function createReview(cardId, optionId) {
  return {
    type: CREATE_REVIEW,
    api: true,
    auth: true,
    payload: {
      method: 'POST',
      url: '/students/reviews',
      data: {
        card: cardId,
        option: optionId
      }
    }
  };
}
