mirror of https://github.com/usememos/memos.git
fix: internal error on pin/unpin (#4332)
This commit is contained in:
parent
5ec3150e0e
commit
7ed3a12a64
|
|
@ -242,6 +242,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error {
|
|||
}
|
||||
set, args = append(set, "`payload` = ?"), append(args, string(payloadBytes))
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return nil
|
||||
}
|
||||
args = append(args, update.ID)
|
||||
|
||||
stmt := "UPDATE `memo` SET " + strings.Join(set, ", ") + " WHERE `id` = ?"
|
||||
|
|
|
|||
|
|
@ -233,6 +233,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error {
|
|||
}
|
||||
set, args = append(set, "payload = "+placeholder(len(args)+1)), append(args, string(payloadBytes))
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
stmt := `UPDATE memo SET ` + strings.Join(set, ", ") + ` WHERE id = ` + placeholder(len(args)+1)
|
||||
args = append(args, update.ID)
|
||||
|
|
|
|||
|
|
@ -220,6 +220,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error {
|
|||
}
|
||||
set, args = append(set, "`payload` = ?"), append(args, string(payloadBytes))
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return nil
|
||||
}
|
||||
args = append(args, update.ID)
|
||||
|
||||
stmt := "UPDATE `memo` SET " + strings.Join(set, ", ") + " WHERE `id` = ?"
|
||||
|
|
|
|||
Loading…
Reference in New Issue