From e196197a7cd79db332df58fe55824491acf13fba Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 29 Apr 2019 14:46:10 +0200 Subject: [PATCH 1/8] implement vueex --- README.md | 2 - client/package-lock.json | 5 +++ client/package.json | 3 +- client/src/api/index.js | 20 ++++++++++ client/src/components/chainetv.vue | 45 ++++----------------- client/src/main.js | 2 + client/src/store/index.js | 64 ++++++++++++++++++++++++++++++ 7 files changed, 101 insertions(+), 40 deletions(-) delete mode 100644 README.md create mode 100644 client/src/api/index.js create mode 100644 client/src/store/index.js diff --git a/README.md b/README.md deleted file mode 100644 index 6787402..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# chainetv_web - diff --git a/client/package-lock.json b/client/package-lock.json index c0af77b..e3e8eae 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -11773,6 +11773,11 @@ "integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==", "dev": true }, + "vuex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.0.tgz", + "integrity": "sha512-mdHeHT/7u4BncpUZMlxNaIdcN/HIt1GsGG5LKByArvYG/v6DvHcOxvDCts+7SRdCoIRGllK8IMZvQtQXLppDYg==" + }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", diff --git a/client/package.json b/client/package.json index cd64562..5dd9825 100644 --- a/client/package.json +++ b/client/package.json @@ -14,7 +14,8 @@ "axios": "^0.18.0", "bulma": "^0.7.4", "vue": "^2.5.2", - "vue-router": "^3.0.1" + "vue-router": "^3.0.1", + "vuex": "^3.1.0" }, "devDependencies": { "autoprefixer": "^7.1.2", diff --git a/client/src/api/index.js b/client/src/api/index.js new file mode 100644 index 0000000..1793707 --- /dev/null +++ b/client/src/api/index.js @@ -0,0 +1,20 @@ +import axios from "axios"; + +const API_PATH=`${process.env.ROOT_API}/api/v1`; + +export function fetchchaine(num){ + + return axios.get(`${API_PATH}/chaine/${num}`) +} + +export function fetchemission(num){ + + return axios.get(`${API_PATH}/chaine/${num}/emission`) + +} + +export function putparsechaine(){ + + return axios.put(`${API_PATH}/chaine/`); + +} \ No newline at end of file diff --git a/client/src/components/chainetv.vue b/client/src/components/chainetv.vue index 37ded3e..72c2b57 100644 --- a/client/src/components/chainetv.vue +++ b/client/src/components/chainetv.vue @@ -29,8 +29,8 @@
-
    -
  • +
      +
    • {{result.chaine}} : {{result.name}}

      • @@ -74,63 +74,34 @@