Commit a8098f1b authored by d.arizona's avatar d.arizona

update malem

parent ccc7b4c2
......@@ -12,6 +12,7 @@ import BaseHeader from '../Components/BaseHeader';
import { Images } from '../Themes';
import BaseText from '../Components/BaseText';
import Toast from 'react-native-toast-message'
import Api from '../Services/Api'
class MyAccountScreen extends Component {
constructor(props) {
......@@ -66,6 +67,19 @@ class MyAccountScreen extends Component {
this.props.navigation.navigate('ChangePasswordScreen');
} else if (type == 'Keluar') {
this.props.authClearData()
Api.create().logout(this.props.auth.user.data.user_id).then((response) => {
// console.log(response.data)
Toast.show({
type: 'success',
position: 'bottom',
text1: 'Success',
text2: `${response.data.message}👋`,
visibilityTime: 2500,
autoHide: true,
// topOffset: 100,
// bottomOffset: 40,
})
})
const resetAction = StackActions.reset({
index: 0,
actions: [
......
......@@ -63,6 +63,7 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => {
const getRate = () => api.get('rate_limit')
const getUser = (username) => api.get('search/users', { q: username })
const login = (body) => api.post('login', body)
const logout = (userId) => api.post(`logout/${userId}`)
const registerUser = (body) => api.post('register', body)
const changePassword = (body) => api.post('change_password', body)
const forgotPassword = (body) => api.post('forgot_password', body)
......@@ -133,6 +134,7 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => {
contactUs,
getUser,
login,
logout,
registerUser,
changePassword,
forgotPassword,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment