fix docker

This commit is contained in:
2026-03-23 10:39:25 +05:30
parent dc19ac2813
commit e7043014a6
3 changed files with 37 additions and 16 deletions

View File

@@ -0,0 +1,10 @@
{
"permissions": {
"allow": [
"Bash(docker compose:*)",
"Bash(npx tsc:*)",
"Bash(curl -s http://127.0.0.1:8000/api/users/by-email/jeet.debnath2004@gmail.com)",
"Bash(ipconfig getifaddr:*)"
]
}
}

View File

@@ -210,16 +210,27 @@ export function useOnboardingTour() {
clearPendingTourStep() clearPendingTourStep()
driverObj.destroy() driverObj.destroy()
}, },
onDestroyed: () => { onNextClick: () => {
const activeIndex = driverObj.getActiveIndex()
const steps = driverObj.getConfig().steps || []
// Last settings step → navigate to /
if (activeIndex === steps.length - 1) {
markOnboardingDone() markOnboardingDone()
clearPendingTourStep() clearPendingTourStep()
driverObj.destroy()
navigate('/')
return
}
driverObj.moveNext()
}, },
steps: getSettingsSteps(isMobile), steps: getSettingsSteps(isMobile),
}) })
driverRef.current = driverObj driverRef.current = driverObj
setTimeout(() => driverObj.drive(), 300) setTimeout(() => driverObj.drive(), 300)
}, []) }, [navigate])
return { startTour, continueTourOnHistory, continueTourOnSettings } return { startTour, continueTourOnHistory, continueTourOnSettings }
} }

View File

@@ -3,7 +3,7 @@
* Handles all communication with the backend API * Handles all communication with the backend API
*/ */
const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8001' const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8001/api'
type ApiOptions = { type ApiOptions = {
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' method?: 'GET' | 'POST' | 'PUT' | 'DELETE'
@@ -57,7 +57,7 @@ export async function registerUser(
}, },
token: string token: string
) { ) {
return apiCall('/api/users/register', { return apiCall('/users/register', {
method: 'POST', method: 'POST',
body: userData, body: userData,
token, token,
@@ -65,7 +65,7 @@ export async function registerUser(
} }
export async function getUserByEmail(email: string, token: string) { export async function getUserByEmail(email: string, token: string) {
return apiCall(`/api/users/by-email/${email}`, { token }) return apiCall(`/users/by-email/${email}`, { token })
} }
export async function updateUserProfile( export async function updateUserProfile(
@@ -73,7 +73,7 @@ export async function updateUserProfile(
updates: { displayName?: string; photoURL?: string; theme?: string }, updates: { displayName?: string; photoURL?: string; theme?: string },
token: string token: string
) { ) {
return apiCall(`/api/users/${userId}`, { return apiCall(`/users/${userId}`, {
method: 'PUT', method: 'PUT',
body: updates, body: updates,
token, token,
@@ -82,7 +82,7 @@ export async function updateUserProfile(
export async function deleteUser(userId: string, token: string) { export async function deleteUser(userId: string, token: string) {
return apiCall<{ message: string; user_deleted: number; entries_deleted: number }>( return apiCall<{ message: string; user_deleted: number; entries_deleted: number }>(
`/api/users/${userId}`, `/users/${userId}`,
{ {
method: 'DELETE', method: 'DELETE',
token, token,
@@ -125,7 +125,7 @@ export async function createEntry(
token: string token: string
) { ) {
return apiCall<{ id: string; message: string }>( return apiCall<{ id: string; message: string }>(
`/api/entries/${userId}`, `/entries/${userId}`,
{ {
method: 'POST', method: 'POST',
body: entryData, body: entryData,
@@ -141,7 +141,7 @@ export async function getUserEntries(
skip = 0 skip = 0
) { ) {
return apiCall<{ entries: JournalEntry[]; total: number }>( return apiCall<{ entries: JournalEntry[]; total: number }>(
`/api/entries/${userId}?limit=${limit}&skip=${skip}`, `/entries/${userId}?limit=${limit}&skip=${skip}`,
{ token } { token }
) )
} }
@@ -151,7 +151,7 @@ export async function getEntry(
entryId: string, entryId: string,
token: string token: string
) { ) {
return apiCall<JournalEntry>(`/api/entries/${userId}/${entryId}`, { return apiCall<JournalEntry>(`/entries/${userId}/${entryId}`, {
token, token,
}) })
} }
@@ -162,7 +162,7 @@ export async function updateEntry(
updates: Partial<JournalEntryCreate>, updates: Partial<JournalEntryCreate>,
token: string token: string
) { ) {
return apiCall(`/api/entries/${userId}/${entryId}`, { return apiCall(`/entries/${userId}/${entryId}`, {
method: 'PUT', method: 'PUT',
body: updates, body: updates,
token, token,
@@ -174,7 +174,7 @@ export async function deleteEntry(
entryId: string, entryId: string,
token: string token: string
) { ) {
return apiCall(`/api/entries/${userId}/${entryId}`, { return apiCall(`/entries/${userId}/${entryId}`, {
method: 'DELETE', method: 'DELETE',
token, token,
}) })
@@ -187,7 +187,7 @@ export async function getEntriesByDate(
token: string token: string
) { ) {
return apiCall<JournalEntry[]>( return apiCall<JournalEntry[]>(
`/api/entries/${userId}/date-range?startDate=${startDate}&endDate=${endDate}`, `/entries/${userId}/date-range?startDate=${startDate}&endDate=${endDate}`,
{ token } { token }
) )
} }
@@ -197,7 +197,7 @@ export async function getEntriesByDate(
export async function convertUTCToIST(utcTimestamp: string) { export async function convertUTCToIST(utcTimestamp: string) {
return apiCall<{ utc: string; ist: string }>( return apiCall<{ utc: string; ist: string }>(
`/api/entries/convert-timestamp/utc-to-ist`, `/entries/convert-timestamp/utc-to-ist`,
{ {
method: 'POST', method: 'POST',
body: { timestamp: utcTimestamp }, body: { timestamp: utcTimestamp },