fix: update clients
This commit is contained in:
parent
d42cca2262
commit
95deebf106
|
|
@ -49,12 +49,12 @@ func (_i *ClientsRouter) RegisterClientsRoutes() {
|
||||||
// define routes
|
// define routes
|
||||||
_i.App.Route("/clients", func(router fiber.Router) {
|
_i.App.Route("/clients", func(router fiber.Router) {
|
||||||
router.Get("/", clientsController.All)
|
router.Get("/", clientsController.All)
|
||||||
router.Get("/:id", clientsController.Show)
|
|
||||||
router.Get("/profile", clientsController.ShowWithAuth)
|
router.Get("/profile", clientsController.ShowWithAuth)
|
||||||
|
router.Get("/:id", clientsController.Show)
|
||||||
router.Post("/", clientsController.Save)
|
router.Post("/", clientsController.Save)
|
||||||
router.Post("/with-user", clientsController.CreateClientWithUser)
|
router.Post("/with-user", clientsController.CreateClientWithUser)
|
||||||
router.Put("/:id", clientsController.Update)
|
|
||||||
router.Put("/update", clientsController.UpdateWithAuth)
|
router.Put("/update", clientsController.UpdateWithAuth)
|
||||||
|
router.Put("/:id", clientsController.Update)
|
||||||
router.Delete("/:id", clientsController.Delete)
|
router.Delete("/:id", clientsController.Delete)
|
||||||
|
|
||||||
// Logo upload routes
|
// Logo upload routes
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,6 @@ func (_i *clientsService) UpdateWithAuth(authToken string, req request.ClientsUp
|
||||||
updateReq := &entity.Clients{
|
updateReq := &entity.Clients{
|
||||||
Name: *req.Name,
|
Name: *req.Name,
|
||||||
Description: req.Description,
|
Description: req.Description,
|
||||||
ClientType: *req.ClientType,
|
|
||||||
ParentClientId: req.ParentClientId,
|
ParentClientId: req.ParentClientId,
|
||||||
LogoUrl: req.LogoUrl,
|
LogoUrl: req.LogoUrl,
|
||||||
LogoImagePath: req.LogoImagePath,
|
LogoImagePath: req.LogoImagePath,
|
||||||
|
|
@ -210,6 +209,8 @@ func (_i *clientsService) UpdateWithAuth(authToken string, req request.ClientsUp
|
||||||
IsActive: req.IsActive,
|
IsActive: req.IsActive,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_i.Log.Info().Interface("Updating client with auth token", updateReq).Msg("")
|
||||||
|
|
||||||
return _i.Repo.Update(clientId, updateReq)
|
return _i.Repo.Update(clientId, updateReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue