Better implementation of Bookmarks, using its own table

This commit is contained in:
Deluan
2020-08-01 12:17:06 -04:00
parent 23d69d26e0
commit ed726c2126
17 changed files with 362 additions and 186 deletions
+3 -1
View File
@@ -23,7 +23,9 @@ func toSqlArgs(rec interface{}) (map[string]interface{}, error) {
err = json.Unmarshal(b, &m)
r := make(map[string]interface{}, len(m))
for f, v := range m {
if !utils.StringInSlice(f, model.AnnotationFields) && v != nil {
isAnnotationField := utils.StringInSlice(f, model.AnnotationFields)
isBookmarkField := utils.StringInSlice(f, model.BookmarkFields)
if !isAnnotationField && !isBookmarkField && v != nil {
r[toSnakeCase(f)] = v
}
}