Merge pull request 'tonitch/front/manageCourses/LinkToBackend' (#125) from tonitch/front/manageCourses/LinkToBackend into wal/front/listingUsers
Reviewed-on: #125
This commit is contained in:
		@ -1,37 +1,17 @@
 | 
				
			|||||||
<script setup>
 | 
					<script setup>
 | 
				
			||||||
  import i18n from "@/i18n.js"
 | 
					  import i18n from "@/i18n.js"
 | 
				
			||||||
  import {ref} from 'vue'
 | 
					  import {ref} from 'vue'
 | 
				
			||||||
const curriculum=[
 | 
					  import { getCourses } from "@/rest/courses.js"
 | 
				
			||||||
  {
 | 
					  import { getTeachers } from "@/rest/Users.js"
 | 
				
			||||||
  "id": 12,
 | 
					 | 
				
			||||||
  "name": "Math pour l'info",
 | 
					 | 
				
			||||||
  "credits": 11,
 | 
					 | 
				
			||||||
  "faculty": "science",
 | 
					 | 
				
			||||||
  "teacher": 42,
 | 
					 | 
				
			||||||
  "Assistants": []},
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
  "id": 42,
 | 
					 | 
				
			||||||
  "name": "Operating Systems",
 | 
					 | 
				
			||||||
  "credits": 8,
 | 
					 | 
				
			||||||
  "faculty": "science",
 | 
					 | 
				
			||||||
  "teacher": 62,
 | 
					 | 
				
			||||||
  "Assistants": []},
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
  "id": 52,
 | 
					 | 
				
			||||||
  "name": "Fonctionnement des ordinateurs",
 | 
					 | 
				
			||||||
  "credits": 11,
 | 
					 | 
				
			||||||
  "faculty": "science",
 | 
					 | 
				
			||||||
  "teacher": 59,
 | 
					 | 
				
			||||||
  "Assistants": []},
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ]
 | 
					  const curriculum = await getCourses()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const profList=[42,45,62,84,59]
 | 
					  const profList = getTeachers()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const createMod = ref(false)
 | 
					  const createMod = ref(false)
 | 
				
			||||||
  const deleteMod = ref(false)
 | 
					  const deleteMod = ref(false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const editElementID = ref(""); 
 | 
					  const editElementID = ref("")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  function editItem(id){
 | 
					  function editItem(id){
 | 
				
			||||||
    editElementID = id;
 | 
					    editElementID = id;
 | 
				
			||||||
 | 
				
			|||||||
@ -93,6 +93,18 @@ export async function getAllUsers(){
 | 
				
			|||||||
	return restGet("/users");
 | 
						return restGet("/users");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Return the list of teachers
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @return a list of teachers
 | 
				
			||||||
 | 
					 * each elements is of the form
 | 
				
			||||||
 | 
					 * - id
 | 
				
			||||||
 | 
					 * - name
 | 
				
			||||||
 | 
					 * - role
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export async function getTeachers(){
 | 
				
			||||||
 | 
						return restGet("/users/teacher")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Get informations about yourself
 | 
					 * Get informations about yourself
 | 
				
			||||||
 | 
				
			|||||||
@ -34,6 +34,21 @@ export async function getCourse(id){
 | 
				
			|||||||
	return restGet("/course/" + id);
 | 
						return restGet("/course/" + id);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Get the list of courses to display on secretary's option
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @return list of courses of the form
 | 
				
			||||||
 | 
					 * - id
 | 
				
			||||||
 | 
					 * - name
 | 
				
			||||||
 | 
					 * - credits
 | 
				
			||||||
 | 
					 * - facutly
 | 
				
			||||||
 | 
					 * - teacher
 | 
				
			||||||
 | 
					 * - Assistants
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					export async function getCourses(){
 | 
				
			||||||
 | 
						return restGet("/course")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Change the options of a course
 | 
					 * Change the options of a course
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user