mirror of
https://github.com/usememos/memos.git
synced 2024-11-10 17:02:21 +08:00
chore: fix list activities typo
This commit is contained in:
parent
e5978a70f5
commit
052216c471
5 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue