All files / src/api/student StudentDataAPI.js

83.33% Statements 10/12
100% Branches 0/0
83.33% Functions 5/6
83.33% Lines 10/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63          1x 1x       1x 1x       1x 1x       1x 1x                 2x       2x                                                        
import axios from "axios";
import { API_ENDPOINTS } from "@/api/endpoints";
 
export class StudentDataAPI {
    async studentGetData() {
        const response = await axios.get(API_ENDPOINTS.student.account.fetch);
        return response;
    }
 
    async searchTeacherByName(teacherName) {
        const response = await axios.get(API_ENDPOINTS.users.find, teacherName);
        return response;
    }
 
    async addProfilePicture(imageFile) {
        const response = await axios.post(API_ENDPOINTS.student.account.picture.add, imageFile);
        return response;
    }
 
    async updateProfilePicture(imageFile) {
        const user = await axios.patch(API_ENDPOINTS.student.account.picture.update, imageFile);
        return user;
    }
 
    async deleteProfilePicture() {
        const response = await axios.delete(API_ENDPOINTS.student.account.picture.delete);
        return response;
    }
 
    async updatePassword(currentPassword, newPassword) {
        const response = await axios.post(API_ENDPOINTS.student.account.password.update, {
            current_password: currentPassword,
            new_password: newPassword,
        });
        return response;
    }
 
    // async update_profile_photo(photo) {
    //     const user = await axios.patch(USERS_ENDPOINT + "/update/user_profile_picture", photo);
    //     return user;
    // }
 
    // async remove_profile_photo() {
    //     const user = await axios.delete(USERS_ENDPOINT + "/delete/user_profile_picture");
    //     return user;
    // }
 
    // async add_education(data) {
    //     const user = await axios.post(USERS_ENDPOINT + "/add/user_education", data);
    //     return user;
    // }
 
    // async update_education(new_data) {
    //     const user = await axios.patch(USERS_ENDPOINT + "/update/user_education", new_data);
    //     return user;
    // }
 
    // async delete_education(uuid) {
    //     const user = await axios.delete(USERS_ENDPOINT + "/delete/user_education/" + uuid);
    //     return user;
    // }
}