Require CSRF token

pull/37/head
Varun Patil 2022-08-19 22:16:13 +00:00
parent af49dbb933
commit 36c9b0f79d
2 changed files with 5 additions and 8 deletions

View File

@ -66,7 +66,6 @@ class ApiController extends Controller {
/** /**
* @NoAdminRequired * @NoAdminRequired
* @NoCSRFRequired
* *
* @return JSONResponse * @return JSONResponse
*/ */
@ -82,7 +81,6 @@ class ApiController extends Controller {
/** /**
* @NoAdminRequired * @NoAdminRequired
* @NoCSRFRequired
* *
* @return JSONResponse * @return JSONResponse
*/ */
@ -123,7 +121,6 @@ class ApiController extends Controller {
/** /**
* @NoAdminRequired * @NoAdminRequired
* @NoCSRFRequired
* *
* @return JSONResponse * @return JSONResponse
*/ */
@ -169,7 +166,6 @@ class ApiController extends Controller {
/** /**
* @NoAdminRequired * @NoAdminRequired
* @NoCSRFRequired
* *
* @return JSONResponse * @return JSONResponse
*/ */

View File

@ -74,6 +74,7 @@
<script> <script>
import * as dav from "../services/DavRequests"; import * as dav from "../services/DavRequests";
import axios from '@nextcloud/axios'
export default { export default {
data() { data() {
@ -322,8 +323,8 @@ export default {
} }
const startState = this.state; const startState = this.state;
const res = await fetch(url); const res = await axios.get(url);
const data = await res.json(); const data = res.data;
if (this.state !== startState) return; if (this.state !== startState) return;
this.days = data; this.days = data;
@ -427,8 +428,8 @@ export default {
let data = []; let data = [];
try { try {
const startState = this.state; const startState = this.state;
const res = await fetch(url); const res = await axios.get(url);
data = await res.json(); const data = res.data;
if (this.state !== startState) return; if (this.state !== startState) return;
this.days.find(d => d.day_id === dayId).detail = data; this.days.find(d => d.day_id === dayId).detail = data;