ludo237/vuejs-carousel

View on GitHub
src/store/actions.js

Summary

Maintainability
A
0 mins
Test Coverage
import Axios from "axios";

export const actions = {

    /**
     * Load the photo from the source provided by
     * the gallery
     *
     * @param commit
     * @param {String} source
     */
    loadPhotos: ({commit}, source) => {
        Axios.get(source).then(function (response) {
            commit("writePhotos", response.data);
        }).catch(function (error) {
            console.error(error);
        });
    }
};