fix: update clients

This commit is contained in:
hanif salafi 2025-10-12 15:23:16 +07:00
parent d42cca2262
commit 95deebf106
2 changed files with 4 additions and 3 deletions

View File

@ -49,12 +49,12 @@ func (_i *ClientsRouter) RegisterClientsRoutes() {
// define routes
_i.App.Route("/clients", func(router fiber.Router) {
router.Get("/", clientsController.All)
router.Get("/:id", clientsController.Show)
router.Get("/profile", clientsController.ShowWithAuth)
router.Get("/:id", clientsController.Show)
router.Post("/", clientsController.Save)
router.Post("/with-user", clientsController.CreateClientWithUser)
router.Put("/:id", clientsController.Update)
router.Put("/update", clientsController.UpdateWithAuth)
router.Put("/:id", clientsController.Update)
router.Delete("/:id", clientsController.Delete)
// Logo upload routes

View File

@ -197,7 +197,6 @@ func (_i *clientsService) UpdateWithAuth(authToken string, req request.ClientsUp
updateReq := &entity.Clients{
Name: *req.Name,
Description: req.Description,
ClientType: *req.ClientType,
ParentClientId: req.ParentClientId,
LogoUrl: req.LogoUrl,
LogoImagePath: req.LogoImagePath,
@ -210,6 +209,8 @@ func (_i *clientsService) UpdateWithAuth(authToken string, req request.ClientsUp
IsActive: req.IsActive,
}
_i.Log.Info().Interface("Updating client with auth token", updateReq).Msg("")
return _i.Repo.Update(clientId, updateReq)
}