This commit is contained in:
fro1991
2025-02-01 19:49:27 +07:00
parent 42c2a8e481
commit 13a2c4d42c
57 changed files with 159 additions and 295 deletions

View File

@ -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 || '');

View File

@ -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) {