Fakultas Ilmu Komputer UI

Commit e6e6531d authored by wulanmantiri's avatar wulanmantiri
Browse files

[REFACTOR] Fix bugs

parent 49758db5
Pipeline #84202 passed with stages
in 9 minutes and 10 seconds
......@@ -13,13 +13,17 @@ const PaymentWebView: FC = () => {
const navigation = useNavigation();
const route = useRoute();
const { url } = route.params as { url: string };
const { user } = useContext(UserContext);
const { user, setUser } = useContext(UserContext);
const postPay = async (state: any) => {
if (state.url.startsWith(`${API_BASE_URL}/payment/midtrans-redirection`)) {
await updateCartApi(user.cart_id, {
const response = await updateCartApi(user.cart_id, {
transaction_status: TransactionStatus.SUCCESS,
});
setUser({
...user,
nutritionist: response.data?.nutritionist || null,
});
navigation.navigate(ROUTES.paymentResult);
}
};
......
......@@ -27,7 +27,11 @@ export interface User {
deadline: string | null;
}
export interface AuthUserResponse extends User {
export interface AuthUserResponse {
id: number | null;
email: string;
name: string;
role: UserRole | null;
transaction_status: TransactionStatus | null;
is_finished_onboarding: boolean;
cart_id: number | null;
......
......@@ -8,4 +8,5 @@ export interface Nutritionist {
another_practice_place: string;
languages: string;
profile_picture?: string;
phone_number: string;
}
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