81e7223560
Text Extraction * bases * go * splitting * structure * movetoasync * movetoasync * settinguptrigger * reorder * storevent * standardisepollingvalidation * unittests * fixlint * fixlint * awscfg * generatesample * followthrough * tests * clena * store * externalidcleanup * clientid * local * baseunittests * putobjecttests * tests
23 lines
421 B
Go
23 lines
421 B
Go
package document
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
func (s *Service) ListByClient(ctx context.Context, id string) ([]*DocumentSummary, error) {
|
|
documents, err := s.cfg.GetDBQueries().ListDocumentsByClient(ctx, id)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
docs := make([]*DocumentSummary, len(documents))
|
|
for i, doc := range documents {
|
|
docs[i] = &DocumentSummary{
|
|
ID: doc.ID,
|
|
Hash: doc.Hash,
|
|
}
|
|
}
|
|
|
|
return docs, nil
|
|
}
|