mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 03:48:06 +08:00
Added study group creation
This commit is contained in:
parent
3c879b5cf2
commit
62cee96b94
3 changed files with 124 additions and 11 deletions
|
@ -8,6 +8,8 @@ import {
|
|||
RegistrationType,
|
||||
StudentStatusPatchType,
|
||||
StudentStatusType,
|
||||
StudyGroupCreateType,
|
||||
StudyGroupType,
|
||||
} from "../../interfaces/Interfaces";
|
||||
|
||||
export let backendURL = "https://stude.keannu1.duckdns.org";
|
||||
|
@ -275,6 +277,7 @@ export async function GetStudentStatusListFiltered() {
|
|||
return instance
|
||||
.get("/api/v1/student_status/filter/near_student_status", config)
|
||||
.then((response) => {
|
||||
console.log("test", response.data);
|
||||
return [true, response.data];
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -315,7 +318,20 @@ export async function GetStudyGroupList() {
|
|||
return instance
|
||||
.get("/api/v1/study_groups/", config)
|
||||
.then((response) => {
|
||||
console.log("test", response.data);
|
||||
return [true, response.data];
|
||||
})
|
||||
.catch((error) => {
|
||||
let error_message = ParseError(error);
|
||||
return [false, error_message];
|
||||
});
|
||||
}
|
||||
|
||||
export async function CreateStudyGroup(info: StudyGroupCreateType) {
|
||||
const config = await GetConfig();
|
||||
console.log("Payload:", info);
|
||||
return instance
|
||||
.post("/api/v1/study_groups/create/", info, config)
|
||||
.then((response) => {
|
||||
return [true, response.data];
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue