Fix[BE-261]: fixing location not preloaded on get one non-bop API

This commit is contained in:
aguhh18
2025-11-21 10:20:07 +07:00
parent 5a73ad0164
commit 6768092e3b
4 changed files with 79 additions and 70 deletions
@@ -71,7 +71,8 @@ func (s expenseService) withRelations(db *gorm.DB) *gorm.DB {
Preload("Nonstocks.Nonstock").
Preload("Nonstocks.Realization").
Preload("Nonstocks.ProjectFlockKandang.Kandang.Location").
Preload("Nonstocks.Kandang")
Preload("Nonstocks.Kandang").
Preload("Nonstocks.Kandang.Location")
}
func (s expenseService) GetAll(c *fiber.Ctx, params *validation.Query) ([]expenseDto.ExpenseListDTO, int64, error) {
@@ -629,6 +630,7 @@ func (s *expenseService) CompleteExpense(c *fiber.Ctx, id uint, notes *string) (
}
err = s.Repository.DB().WithContext(c.Context()).Transaction(func(tx *gorm.DB) error {
approvalSvc := commonSvc.NewApprovalService(commonRepo.NewApprovalRepository(tx))
approvalAction := entity.ApprovalActionApproved