feat: fixing ppid data categories
This commit is contained in:
parent
d8c994d958
commit
960d21a2ee
|
|
@ -9,8 +9,10 @@ import (
|
|||
func PpidDataCategoriesResponseMapper(ppidDataCategoriesReq *entity.PpidDataCategories, childPpidDataCategoriesReq []*entity.PpidDataCategories) (ppidDataCategoriesRes *res.PpidDataCategoriesResponse) {
|
||||
if ppidDataCategoriesReq != nil {
|
||||
var childPpidDataCategoriesRes []*res.PpidDataCategoriesResponse
|
||||
for _, item := range childPpidDataCategoriesReq {
|
||||
childPpidDataCategoriesRes = append(childPpidDataCategoriesRes, PpidDataCategoriesResponseMapper(item, nil))
|
||||
if childPpidDataCategoriesReq != nil && len(childPpidDataCategoriesReq) > 0 {
|
||||
for _, item := range childPpidDataCategoriesReq {
|
||||
childPpidDataCategoriesRes = append(childPpidDataCategoriesRes, PpidDataCategoriesResponseMapper(item, nil))
|
||||
}
|
||||
}
|
||||
|
||||
ppidDataCategoriesRes = &res.PpidDataCategoriesResponse{
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ func (_i *ppidDataCategoriesRepository) GetAll(req request.PpidDataCategoriesQue
|
|||
var count int64
|
||||
|
||||
_i.Log.Info().Str("timestamp", time.Now().
|
||||
Format(time.RFC3339)).Str("Service:GetAll", "Interface:ppidDataCategoriesRepository").
|
||||
Format(time.RFC3339)).Str("Service:GetAlls", "Interface:ppidDataCategoriesRepository").
|
||||
Interface("req", req).Msg("")
|
||||
|
||||
query := _i.DB.DB.Model(&entity.PpidDataCategories{})
|
||||
|
|
@ -134,6 +134,10 @@ func (_i *ppidDataCategoriesRepository) FindOneBySlug(slug string) (ppidDataCate
|
|||
return nil, err
|
||||
}
|
||||
|
||||
_i.Log.Info().Str("timestamp", time.Now().
|
||||
Format(time.RFC3339)).Str("Service:FindOneBySlug", "Interface:FindOneBySlug").
|
||||
Interface("ppidDataCategories", ppidDataCategories).Msg("")
|
||||
|
||||
return ppidDataCategories, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,10 @@ func (_i *ppidDataCategoriesService) ShowBySlug(slug string) (ppidDataCategories
|
|||
}
|
||||
|
||||
req := request.PpidDataCategoriesQueryRequest{
|
||||
ParentId: result.ParentId,
|
||||
ParentId: &result.ID,
|
||||
Pagination: &paginator.Pagination{
|
||||
Limit: 20,
|
||||
},
|
||||
}
|
||||
subResult, _, _ := _i.Repo.GetAll(req)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue