Linking front for forum creation
This commit is contained in:
@ -5,21 +5,15 @@ import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
|
||||
* List forums of a course
|
||||
*/
|
||||
export async function getForumsOfCourse(id){
|
||||
ForumsOfCurrentCourse.value = [
|
||||
{
|
||||
id: 1,
|
||||
name: "forum~1"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "forum~2"
|
||||
},
|
||||
]
|
||||
// ForumsOfCurrentCourse = await restGet("/forums/" + id)
|
||||
ForumsOfCurrentCourse.value = await restGet("/forums/" + id)
|
||||
}
|
||||
|
||||
export const ForumsOfCurrentCourse = ref();
|
||||
|
||||
export function createForum(id, name){
|
||||
restPost("/forums/" + id, {name: name}).then(_ => getForumsOfCourse(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* List post of a specified forum
|
||||
*/
|
||||
|
Reference in New Issue
Block a user