mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-14 20:07:50 +00:00
chore: add shortcut creator field
This commit is contained in:
@ -46,6 +46,20 @@ func (raw *shortcutRaw) toShortcut() *api.Shortcut {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Store) ComposeShortcut(ctx context.Context, shortcut *api.Shortcut) error {
|
||||
user, err := s.FindUser(ctx, &api.UserFind{
|
||||
ID: &shortcut.CreatorID,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
user.OpenID = ""
|
||||
user.UserSettingList = nil
|
||||
shortcut.Creator = user
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Store) CreateShortcut(ctx context.Context, create *api.ShortcutCreate) (*api.Shortcut, error) {
|
||||
tx, err := s.db.BeginTx(ctx, nil)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user