-
-
-
-
- Vocabulary
-
- The legend of naresh
-
-
-
-
-
-
{loadingModal?(
diff --git a/src/roles/teacher/setting/hooks/useSettings.jsx b/src/roles/teacher/setting/hooks/useSettings.jsx
index 0a7fff1..9578bfd 100644
--- a/src/roles/teacher/setting/hooks/useSettings.jsx
+++ b/src/roles/teacher/setting/hooks/useSettings.jsx
@@ -53,7 +53,7 @@ const useSettings = () => {
const formData = new FormData();
formData.append('NAME_USERS', profile.NAME_USERS);
formData.append('EMAIL', profile.EMAIL);
- formData.append('NISN', profile.NISN);
+ formData.append('NIP', profile.NIP);
if (selectedImage) {
formData.append('PICTURE', selectedImage);
diff --git a/src/roles/teacher/setting/services/SettingService.jsx b/src/roles/teacher/setting/services/SettingService.jsx
index fb395d3..be4bdf1 100644
--- a/src/roles/teacher/setting/services/SettingService.jsx
+++ b/src/roles/teacher/setting/services/SettingService.jsx
@@ -1,5 +1,4 @@
-import axios from 'axios';
-import { API_URL } from '../../../../utils/Constant';
+import axiosInstance from '../../../../utils/axiosInstance';
const config = {
headers: {
@@ -9,7 +8,7 @@ const config = {
const fetchProfile = async () => {
try {
- const response = await axios.get(`${API_URL}/getMe`, config);
+ const response = await axiosInstance.get(`/getMe`, config);
return response.data;
} catch (error) {
throw error;
@@ -17,16 +16,8 @@ const fetchProfile = async () => {
};
const updateProfile = async (id, formData) => {
-
- const cfg = {
- headers: {
- 'Content-Type': 'multipart/form-data',
- Authorization: localStorage.getItem('token')
- },
- };
-
try {
- const response = await axios.put(`${API_URL}/user/update/${id}`, formData, cfg);
+ const response = await axiosInstance.put(`/user/update/${id}`, formData);
return response.data;
} catch (error) {
throw error;
@@ -34,14 +25,8 @@ const updateProfile = async (id, formData) => {
};
const updatePassword = async (userId, passwordData) => {
- const cfg = {
- headers: {
- Authorization: localStorage.getItem('token'),
- 'Content-Type': 'application/json',
- },
- };
try {
- const response = await axios.put(`${API_URL}/user/update/password/${userId}`, passwordData, cfg);
+ const response = await axiosInstance.put(`/user/update/password/${userId}`, passwordData);
return response.data;
} catch (error) {
throw error;
diff --git a/src/roles/teacher/setting/views/Setting.jsx b/src/roles/teacher/setting/views/Setting.jsx
index 9adbb1f..229cd54 100644
--- a/src/roles/teacher/setting/views/Setting.jsx
+++ b/src/roles/teacher/setting/views/Setting.jsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
-import { Table, Row, Col, Nav, Tab, Button, Form, InputGroup, Dropdown, DropdownButton, Modal } from 'react-bootstrap';
+import { Table, Row, Col, Nav, Tab, Button, Form, InputGroup, Dropdown, DropdownButton, Modal, Spinner } from 'react-bootstrap';
import avatar from '../../../../assets/images/default-avatar.jpg';
import ilustration from '../../../../assets/images/illustration/changePass.png';
import successModal from '../../../../assets/images/illustration/successModal.png';