import PhotosActionTypes from "./photos.types";

export const addPhoto = (photo) => ({
  type: PhotosActionTypes.ADD_PHOTO,
  payload: photo,
});

export const removePhotos = (photoIds) => ({
  type: PhotosActionTypes.REMOVE_PHOTOS,
  payload: photoIds,
});

export const removeAllPhotos = () => ({
  type: PhotosActionTypes.REMOVE_ALL_PHOTOS,
});

export const uploadAllPhotos = () => ({
  type: PhotosActionTypes.UPLOAD_ALL_PHOTOS_START,
});

export const uploadSelectedPhotos = (photoIds) => ({
  type: PhotosActionTypes.UPLOAD_SELECTED_PHOTOS_START,
  payload: photoIds,
});

export const uploadPhotosSuccess = () => ({
  type: PhotosActionTypes.UPLOAD_PHOTO_SUCCESS,
});

export const uploadPhotosFailure = (error) => ({
  type: PhotosActionTypes.UPLOAD_PHOTO_FAILURE,
  payload: error,
});
