chore: fix list activities typo

This commit is contained in:
Steven 2023-10-27 01:11:41 +08:00
parent e5978a70f5
commit 052216c471
5 changed files with 6 additions and 6 deletions

View file

@ -108,7 +108,7 @@ func copydb(fromProfile, toProfile *_profile.Profile) error {
func copyActivity(ctx context.Context, fromDriver, toDriver store.Driver) error {
println("Copying Activity...")
list, err := fromDriver.ListActivity(ctx, &store.FindActivity{})
list, err := fromDriver.ListActivities(ctx, &store.FindActivity{})
if err != nil {
return err
}

View file

@ -26,5 +26,5 @@ func (s *Store) CreateActivity(ctx context.Context, create *Activity) (*Activity
}
func (s *Store) ListActivity(ctx context.Context, find *FindActivity) ([]*Activity, error) {
return s.driver.ListActivity(ctx, find)
return s.driver.ListActivities(ctx, find)
}

View file

@ -39,7 +39,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
id32 := int32(id)
list, err := d.ListActivity(ctx, &store.FindActivity{ID: &id32})
list, err := d.ListActivities(ctx, &store.FindActivity{ID: &id32})
if err != nil || len(list) == 0 {
return nil, errors.Wrap(err, "failed to find activity")
}
@ -47,7 +47,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
return list[0], nil
}
func (d *DB) ListActivity(ctx context.Context, find *store.FindActivity) ([]*store.Activity, error) {
func (d *DB) ListActivities(ctx context.Context, find *store.FindActivity) ([]*store.Activity, error) {
where, args := []string{"1 = 1"}, []any{}
if find.ID != nil {

View file

@ -35,7 +35,7 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
return create, nil
}
func (d *DB) ListActivity(ctx context.Context, find *store.FindActivity) ([]*store.Activity, error) {
func (d *DB) ListActivities(ctx context.Context, find *store.FindActivity) ([]*store.Activity, error) {
where, args := []string{"1 = 1"}, []any{}
if find.ID != nil {

View file

@ -22,7 +22,7 @@ type Driver interface {
// Activity model related methods.
CreateActivity(ctx context.Context, create *Activity) (*Activity, error)
ListActivity(ctx context.Context, find *FindActivity) ([]*Activity, error)
ListActivities(ctx context.Context, find *FindActivity) ([]*Activity, error)
// Resource model related methods.
CreateResource(ctx context.Context, create *Resource) (*Resource, error)