Fakultas Ilmu Komputer UI

Commit 4cc5c8f8 authored by Kefas Satrio Bangkit Solidedantyo's avatar Kefas Satrio Bangkit Solidedantyo
Browse files

Merge branch 'last-fix' into 'staging'

Fix bugs

See merge request !85
parents 32da273e fc06ad77
Pipeline #84203 passed with stages
in 31 minutes and 50 seconds
...@@ -85,7 +85,7 @@ android: ...@@ -85,7 +85,7 @@ android:
- yarn install - yarn install
- export ANDROID_SDK_ROOT=/usr/lib/android-sdk - export ANDROID_SDK_ROOT=/usr/lib/android-sdk
- cd android - cd android
- chmod +x gradlew && ./gradlew clean && ./gradlew assembleRelease - chmod +x gradlew && ./gradlew assembleRelease
- cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk - cd .. && cp android/app/build/outputs/apk/release/app-release.apk $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.apk
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
......
...@@ -13,13 +13,17 @@ const PaymentWebView: FC = () => { ...@@ -13,13 +13,17 @@ const PaymentWebView: FC = () => {
const navigation = useNavigation(); const navigation = useNavigation();
const route = useRoute(); const route = useRoute();
const { url } = route.params as { url: string }; const { url } = route.params as { url: string };
const { user } = useContext(UserContext); const { user, setUser } = useContext(UserContext);
const postPay = async (state: any) => { const postPay = async (state: any) => {
if (state.url.startsWith(`${API_BASE_URL}/payment/midtrans-redirection`)) { 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, transaction_status: TransactionStatus.SUCCESS,
}); });
setUser({
...user,
nutritionist: response.data?.nutritionist || null,
});
navigation.navigate(ROUTES.paymentResult); navigation.navigate(ROUTES.paymentResult);
} }
}; };
......
...@@ -27,7 +27,11 @@ export interface User { ...@@ -27,7 +27,11 @@ export interface User {
deadline: string | null; 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; transaction_status: TransactionStatus | null;
is_finished_onboarding: boolean; is_finished_onboarding: boolean;
cart_id: number | null; cart_id: number | null;
......
...@@ -8,4 +8,5 @@ export interface Nutritionist { ...@@ -8,4 +8,5 @@ export interface Nutritionist {
another_practice_place: string; another_practice_place: string;
languages: string; languages: string;
profile_picture?: 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