fix docker
This commit is contained in:
10
.claude/settings.local.json
Normal file
10
.claude/settings.local.json
Normal 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:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -210,16 +210,27 @@ export function useOnboardingTour() {
|
||||
clearPendingTourStep()
|
||||
driverObj.destroy()
|
||||
},
|
||||
onDestroyed: () => {
|
||||
onNextClick: () => {
|
||||
const activeIndex = driverObj.getActiveIndex()
|
||||
const steps = driverObj.getConfig().steps || []
|
||||
|
||||
// Last settings step → navigate to /
|
||||
if (activeIndex === steps.length - 1) {
|
||||
markOnboardingDone()
|
||||
clearPendingTourStep()
|
||||
driverObj.destroy()
|
||||
navigate('/')
|
||||
return
|
||||
}
|
||||
|
||||
driverObj.moveNext()
|
||||
},
|
||||
steps: getSettingsSteps(isMobile),
|
||||
})
|
||||
|
||||
driverRef.current = driverObj
|
||||
setTimeout(() => driverObj.drive(), 300)
|
||||
}, [])
|
||||
}, [navigate])
|
||||
|
||||
return { startTour, continueTourOnHistory, continueTourOnSettings }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* 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 = {
|
||||
method?: 'GET' | 'POST' | 'PUT' | 'DELETE'
|
||||
@@ -57,7 +57,7 @@ export async function registerUser(
|
||||
},
|
||||
token: string
|
||||
) {
|
||||
return apiCall('/api/users/register', {
|
||||
return apiCall('/users/register', {
|
||||
method: 'POST',
|
||||
body: userData,
|
||||
token,
|
||||
@@ -65,7 +65,7 @@ export async function registerUser(
|
||||
}
|
||||
|
||||
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(
|
||||
@@ -73,7 +73,7 @@ export async function updateUserProfile(
|
||||
updates: { displayName?: string; photoURL?: string; theme?: string },
|
||||
token: string
|
||||
) {
|
||||
return apiCall(`/api/users/${userId}`, {
|
||||
return apiCall(`/users/${userId}`, {
|
||||
method: 'PUT',
|
||||
body: updates,
|
||||
token,
|
||||
@@ -82,7 +82,7 @@ export async function updateUserProfile(
|
||||
|
||||
export async function deleteUser(userId: string, token: string) {
|
||||
return apiCall<{ message: string; user_deleted: number; entries_deleted: number }>(
|
||||
`/api/users/${userId}`,
|
||||
`/users/${userId}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
token,
|
||||
@@ -125,7 +125,7 @@ export async function createEntry(
|
||||
token: string
|
||||
) {
|
||||
return apiCall<{ id: string; message: string }>(
|
||||
`/api/entries/${userId}`,
|
||||
`/entries/${userId}`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: entryData,
|
||||
@@ -141,7 +141,7 @@ export async function getUserEntries(
|
||||
skip = 0
|
||||
) {
|
||||
return apiCall<{ entries: JournalEntry[]; total: number }>(
|
||||
`/api/entries/${userId}?limit=${limit}&skip=${skip}`,
|
||||
`/entries/${userId}?limit=${limit}&skip=${skip}`,
|
||||
{ token }
|
||||
)
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export async function getEntry(
|
||||
entryId: string,
|
||||
token: string
|
||||
) {
|
||||
return apiCall<JournalEntry>(`/api/entries/${userId}/${entryId}`, {
|
||||
return apiCall<JournalEntry>(`/entries/${userId}/${entryId}`, {
|
||||
token,
|
||||
})
|
||||
}
|
||||
@@ -162,7 +162,7 @@ export async function updateEntry(
|
||||
updates: Partial<JournalEntryCreate>,
|
||||
token: string
|
||||
) {
|
||||
return apiCall(`/api/entries/${userId}/${entryId}`, {
|
||||
return apiCall(`/entries/${userId}/${entryId}`, {
|
||||
method: 'PUT',
|
||||
body: updates,
|
||||
token,
|
||||
@@ -174,7 +174,7 @@ export async function deleteEntry(
|
||||
entryId: string,
|
||||
token: string
|
||||
) {
|
||||
return apiCall(`/api/entries/${userId}/${entryId}`, {
|
||||
return apiCall(`/entries/${userId}/${entryId}`, {
|
||||
method: 'DELETE',
|
||||
token,
|
||||
})
|
||||
@@ -187,7 +187,7 @@ export async function getEntriesByDate(
|
||||
token: string
|
||||
) {
|
||||
return apiCall<JournalEntry[]>(
|
||||
`/api/entries/${userId}/date-range?startDate=${startDate}&endDate=${endDate}`,
|
||||
`/entries/${userId}/date-range?startDate=${startDate}&endDate=${endDate}`,
|
||||
{ token }
|
||||
)
|
||||
}
|
||||
@@ -197,7 +197,7 @@ export async function getEntriesByDate(
|
||||
|
||||
export async function convertUTCToIST(utcTimestamp: string) {
|
||||
return apiCall<{ utc: string; ist: string }>(
|
||||
`/api/entries/convert-timestamp/utc-to-ist`,
|
||||
`/entries/convert-timestamp/utc-to-ist`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: { timestamp: utcTimestamp },
|
||||
|
||||
Reference in New Issue
Block a user