mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: clean binary entries
This commit is contained in:
@@ -25,18 +25,6 @@ func (d *DB) CreateActivity(ctx context.Context, create *store.Activity) (*store
|
||||
placeholder := []string{"?", "?", "?", "?"}
|
||||
args := []any{create.CreatorID, create.Type.String(), create.Level.String(), payloadString}
|
||||
|
||||
if create.ID != 0 {
|
||||
fields = append(fields, "`id`")
|
||||
placeholder = append(placeholder, "?")
|
||||
args = append(args, create.ID)
|
||||
}
|
||||
|
||||
if create.CreatedTs != 0 {
|
||||
fields = append(fields, "`created_ts`")
|
||||
placeholder = append(placeholder, "?")
|
||||
args = append(args, create.CreatedTs)
|
||||
}
|
||||
|
||||
stmt := "INSERT INTO activity (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING `id`, `created_ts`"
|
||||
if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(
|
||||
&create.ID,
|
||||
|
Reference in New Issue
Block a user