diff --git a/static/reports/dist/js/app.js b/static/reports/dist/js/app.js index 2fee693..596e1df 100644 --- a/static/reports/dist/js/app.js +++ b/static/reports/dist/js/app.js @@ -16,7 +16,7 @@ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'App',\n setup(__props, {\n expose: __expose\n }) {\n __expose();\n axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n let username = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(\"\");\n let content = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(\"\");\n let reports = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)([]);\n function createReport() {\n if (username.value != \"\" && content.value != \"\") {\n (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n method: 'post',\n url: 'https://notes-lib-2.000webhostapp.com/createReport.php',\n data: {\n author: username.value,\n content: content.value\n }\n }).then(() => getData());\n username.value = \"\";\n content.value = \"\";\n }\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount)(() => getData());\n function getData() {\n axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get('https://notes-lib-2.000webhostapp.com/readReports.php').then(response => {\n reports.value = response;\n });\n }\n const __returned__ = {\n get username() {\n return username;\n },\n set username(v) {\n username = v;\n },\n get content() {\n return content;\n },\n set content(v) {\n content = v;\n },\n get reports() {\n return reports;\n },\n set reports(v) {\n reports = v;\n },\n createReport,\n getData,\n get axios() {\n return axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n },\n ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,\n onBeforeMount: vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://reports/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'App',\n setup(__props, {\n expose: __expose\n }) {\n __expose();\n axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';\n let username = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(\"\");\n let content = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(\"\");\n let reports = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)([]);\n function createReport() {\n if (username.value != \"\" && content.value != \"\") {\n (0,axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n method: 'post',\n url: 'https://notes-lib-2.000webhostapp.com/createReport.php',\n data: {\n author: username.value,\n content: content.value\n }\n }).then(() => getData());\n username.value = \"\";\n content.value = \"\";\n }\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount)(() => getData());\n function getData() {\n axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].get('https://notes-lib-2.000webhostapp.com/readReports.php').then(response => {\n reports.value = response;\n reports.value.data = reports.value.data.reverse();\n });\n }\n const __returned__ = {\n get username() {\n return username;\n },\n set username(v) {\n username = v;\n },\n get content() {\n return content;\n },\n set content(v) {\n content = v;\n },\n get reports() {\n return reports;\n },\n set reports(v) {\n reports = v;\n },\n createReport,\n getData,\n get axios() {\n return axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n },\n ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,\n onBeforeMount: vue__WEBPACK_IMPORTED_MODULE_0__.onBeforeMount\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://reports/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), diff --git a/static/reports/src/App.vue b/static/reports/src/App.vue index f55d120..dd7aff1 100644 --- a/static/reports/src/App.vue +++ b/static/reports/src/App.vue @@ -32,6 +32,7 @@ function getData() { .get('https://notes-lib-2.000webhostapp.com/readReports.php') .then((response) => { reports.value = response; + reports.value.data = reports.value.data.reverse(); }) }