update
This commit is contained in:
@ -14,6 +14,7 @@ const BasicSettings = () => {
|
||||
// const user = localStorage.getItem('user');
|
||||
// const parsedUser = user ? JSON.parse(user) : null;
|
||||
const parsedUser = getAuth()?.user;
|
||||
console.log('parsedUser :', parsedUser);
|
||||
const [newUsername, setNewUsername] = useState<string>(parsedUser?.username || '');
|
||||
const [newEmail, setNewEmail] = useState<string>(parsedUser?.email || '');
|
||||
const [newName, setNewName] = useState<string>(parsedUser?.name || '');
|
||||
|
||||
@ -34,7 +34,7 @@ const initialProps: ContextProps = {
|
||||
|
||||
const AccountUserProfileContext = createContext<ContextProps>(initialProps);
|
||||
|
||||
const API_URL = apiConfig.service_user;
|
||||
const API_URL = apiConfig.service_dashboard;
|
||||
|
||||
const AccountUserProfileContextProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
/* state */
|
||||
@ -60,8 +60,7 @@ const AccountUserProfileContextProvider = ({ children }: { children: React.React
|
||||
try {
|
||||
const validate = await PostData(`${API_URL}/login`, {
|
||||
password: newPassword.current_password,
|
||||
username: newPassword.username,
|
||||
application: 'credit'
|
||||
username: newPassword.username
|
||||
});
|
||||
|
||||
if (!validate || !validate.status) {
|
||||
|
||||
Reference in New Issue
Block a user