Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: memo find for mysql(#3387)

wzc900a9212f81573
diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go
index 51431ba3d..15b19dc6d 100644
--- a/store/db/mysql/memo.go
+++ b/store/db/mysql/memo.go
@@ -91,7 +91,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo
where, args = append(where, "`memo`.`payload` = ?"), append(args, *v.Raw)
}
if v.Tag != nil {
- where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(payload, '$.property.tags[*]'), ?, '$')"), append(args, *v.Tag)
+ where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(`memo`.`payload`, '$.property.tags'), ?)"), append(args, fmt.Sprintf(`["%s"]`, *v.Tag))
}
}
if find.ExcludeComments {