Course: Fix request to check is_allowed_to_edit with course context

pull/5271/head
Angel Fernando Quiroz Campos 2 years ago
parent 57b43691a9
commit 1ffcd00e51
  1. 7
      assets/vue/composables/userPermissions.js

@ -1,3 +1,5 @@
import { storeToRefs } from "pinia"
import { useCidReqStore } from "../store/cidReq"
import axios from "axios" import axios from "axios"
export async function checkIsAllowedToEdit( export async function checkIsAllowedToEdit(
@ -6,6 +8,9 @@ export async function checkIsAllowedToEdit(
sessionCoach = false, sessionCoach = false,
checkStudentView = true, checkStudentView = true,
) { ) {
const cidReqStore = useCidReqStore()
const { course, session } = storeToRefs(cidReqStore)
try { try {
const { data } = await axios.get(window.location.origin + "/permissions/is_allowed_to_edit", { const { data } = await axios.get(window.location.origin + "/permissions/is_allowed_to_edit", {
params: { params: {
@ -13,6 +18,8 @@ export async function checkIsAllowedToEdit(
coach, coach,
sessioncoach: sessionCoach, sessioncoach: sessionCoach,
checkstudentview: checkStudentView, checkstudentview: checkStudentView,
cid: course.value?.id,
sid: session.value?.id,
}, },
}) })

Loading…
Cancel
Save