File tree Expand file tree Collapse file tree 7 files changed +31
-8
lines changed
Expand file tree Collapse file tree 7 files changed +31
-8
lines changed Original file line number Diff line number Diff line change 1- base_url = yourAPI
1+
2+ # VITE_API_URL=https://smartfarming.teknohole.com
Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ dist-ssr
2525* .njsproj
2626* .sln
2727* .sw ?
28+ .vercel
Original file line number Diff line number Diff line change @@ -69,9 +69,14 @@ const DeleteAccountPage = () => {
6969 setErrorMessage ( "Gagal: Token akses tidak ditemukan." ) ;
7070 }
7171 } catch ( error ) {
72- setErrorMessage (
73- error . message || "Login Gagal. Cek username & password Anda." ,
74- ) ;
72+ const serverMessage =
73+ error . detail || error . message || "Username atau Password salah." ;
74+ const finalMessage =
75+ typeof serverMessage === "object"
76+ ? JSON . stringify ( serverMessage )
77+ : serverMessage ;
78+
79+ setErrorMessage ( finalMessage ) ;
7580 } finally {
7681 setLoading ( false ) ;
7782 }
@@ -160,6 +165,8 @@ const DeleteAccountPage = () => {
160165 < User className = "absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 w-4 h-4 z-10" />
161166 < Input
162167 type = "text"
168+ name = "username"
169+ autoComplete = "username"
163170 placeholder = "Masukkan username..."
164171 value = { username }
165172 onChange = { ( e ) => setUsername ( e . target . value ) }
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ const PrivacyPolicyPage = () => {
1212 const fetchTerms = async ( ) => {
1313 try {
1414 const response = await getTermsService ( ) ;
15- // Ambil string content
1615 let rawText = response . data ?. content || response . content || "" ;
1716
1817 if ( rawText ) {
Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ const router = createBrowserRouter([
7474 ] ,
7575 } ,
7676 // Catch all routes
77+ {
78+ path : "/privacy-policy" ,
79+ element : < PrivacyPolicyPage /> ,
80+ } ,
81+ {
82+ path : "/delete-account" ,
83+ element : < DeleteAccountPage /> ,
84+ } ,
7785 {
7886 path : "*" ,
7987 element : < NotFoundPage /> ,
Original file line number Diff line number Diff line change 11import axios from "axios" ;
22
3- const API_BASE_URL = import . meta. env . base_url ;
3+ const API_BASE_URL = import . meta. env . VITE_API_URL ;
44
55const getApiUrl = ( ) => {
6- const isLocal = window . location . hostname === "localhost" ;
7- return isLocal || API_BASE_URL || "/api-proxy" ;
6+ return API_BASE_URL || "/api-proxy" ;
87} ;
98
109export const loginService = async ( username , password ) => {
Original file line number Diff line number Diff line change 1+ {
2+ "rewrites" : [
3+ {
4+ "source" : " /(.*)" ,
5+ "destination" : " /"
6+ }
7+ ]
8+ }
You can’t perform that action at this time.
0 commit comments