MSP-5186 Add /application/get_all endpoint
This commit is contained in:
1 parent
f8fa58a09c
commit
fa2f88c869
7 files changed
+182
No files matched your search
@@ -264,6 +264,19 @@ func (s Application) NextId(ctx context.Context) (int, error) {
|
||||
return nextId, nil
|
||||
}
|
||||
|
||||
func (s Application) GetAll(ctx context.Context) ([]domain.Application, error) {
|
||||
apps, err := s.appRepo.GetAllApplications(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.WithMessage(err, "get applications list")
|
||||
}
|
||||
|
||||
result := make([]domain.Application, 0, len(apps))
|
||||
for _, app := range apps {
|
||||
result = append(result, s.convertApplication(app))
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (s Application) convertApplication(req entity.Application) domain.Application {
|
||||
desc := ""
|
||||
if req.Description != nil {
|
||||
|
||||
Reference in new issue
Block a user