Skip to content

Commit

Permalink
updated package + routes with new items added
Browse files Browse the repository at this point in the history
  • Loading branch information
leoRysing committed Feb 15, 2024
1 parent 6345784 commit d829b62
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 13 deletions.
6 changes: 3 additions & 3 deletions backend/src/routes/etrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ func SetupETradeRoutes(router *gin.Engine, db *gorm.DB) {
etradeService := services.NewETradeService(db)
etradeController := controllers.NewETradeController(etradeService)

etradeRoutes := router.Group("/users/:user_id")
etradeRoutes := router.Group("/users/")
{
etradeRoutes.GET("/etrade-redirect", etradeController.GetRedirectURL)
etradeRoutes.POST("/etrade-verify", etradeController.Verify)
etradeRoutes.GET("/etrade-redirect/:user_id", etradeController.GetRedirectURL)
etradeRoutes.POST("/etrade-verify/:user_id", etradeController.Verify)
}
}
16 changes: 8 additions & 8 deletions backend/src/routes/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ func SetupUserRoutes(router *gin.Engine, db *gorm.DB) {
userRoutes.PUT("/:id", userController.UpdateUserById)
userRoutes.DELETE("/:id", userController.DeleteUserById)

userRoutes.POST("/:user_id/create-long-term-goal", userController.CreateLongTermGoalForUser)
userRoutes.GET("/:user_id/get-long-term-goals", userController.GetLongTermGoalsForUser)
userRoutes.PUT("/:user_id/update-long-term-goal/:goal_id", userController.UpdateLongTermGoalForUser)
userRoutes.DELETE("/:user_id/delete-long-term-goal/:goal_id", userController.DeleteLongTermGoalForUser)
userRoutes.POST("/long-term-goal/:user_id", userController.CreateLongTermGoalForUser)
userRoutes.GET("/long-term-goal/:user_id/", userController.GetLongTermGoalsForUser)
userRoutes.PUT("/long-term-goal/:user_id/:goal_id", userController.UpdateLongTermGoalForUser)
userRoutes.DELETE("/long-term-goal/:user_id/:goal_id", userController.DeleteLongTermGoalForUser)

userRoutes.POST("/:user_id/create-short-term-goal", userController.CreateShortTermGoalForUser)
userRoutes.GET("/:user_id/get-short-term-goals", userController.GetShortTermGoalsForUser)
userRoutes.PUT("/:user_id/update-short-term-goal/:goal_id", userController.UpdateShortTermGoalForUser)
userRoutes.DELETE("/:user_id/delete-short-term-goal/:goal_id", userController.DeleteShortTermGoalForUser)
userRoutes.POST("/short-term-goal/:user_id/", userController.CreateShortTermGoalForUser)
userRoutes.GET("/short-term-goal/:user_id/", userController.GetShortTermGoalsForUser)
userRoutes.PUT("/short-term-goal/:user_id/:goal_id", userController.UpdateShortTermGoalForUser)
userRoutes.DELETE("/short-term-goal/:user_id/:goal_id", userController.DeleteShortTermGoalForUser)
}
}
2 changes: 1 addition & 1 deletion frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { User } from './types/types';
export default function App() {
const [users, setUsers] = useState<User[]>();
useEffect(() => {
getAllUsers().then((data) => setUsers(data))
getAllUsers().then((data) => setUsers(data.slice(10)))
}, [])
return (
<View style={styles.container}>
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"web": "expo start --web"
},
"dependencies": {
"@expo/ngrok": "^4.1.0",
"@react-navigation/native": "^6.1.9",
"autoprefixer": "^10.4.16",
"axios": "^1.6.4",
Expand Down
Loading

0 comments on commit d829b62

Please sign in to comment.