(_ context.Context, objID uint)
| 321 | } |
| 322 | |
| 323 | func (s *sqlDatabase) GetFileObject(_ context.Context, objID uint) (params.FileObject, error) { |
| 324 | var fileObj FileObject |
| 325 | if err := s.objectsConn.Preload("TagsList").Where("id = ?", objID).Omit("content").First(&fileObj).Error; err != nil { |
| 326 | if errors.Is(err, gorm.ErrRecordNotFound) { |
| 327 | return params.FileObject{}, runnerErrors.NewNotFoundError("could not find file object with ID: %d", objID) |
| 328 | } |
| 329 | return params.FileObject{}, fmt.Errorf("error trying to find file object: %w", err) |
| 330 | } |
| 331 | return s.sqlFileObjectToCommonParams(fileObj), nil |
| 332 | } |
| 333 | |
| 334 | func (s *sqlDatabase) SearchFileObjectByTags(_ context.Context, tags []string, page, pageSize uint64) (params.FileObjectPaginatedResponse, error) { |
| 335 | if page == 0 { |
nothing calls this directly
no test coverage detected