mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve database field default filling https://github.com/siyuan-note/siyuan/issues/11966
This commit is contained in:
parent
f1bf15146a
commit
46f81b93ed
1 changed files with 8 additions and 8 deletions
|
|
@ -875,21 +875,21 @@ func (filter *ViewFilter) GetAffectValue(key *Key, defaultVal *Value, addingBloc
|
|||
case KeyTypeBlock:
|
||||
switch filter.Operator {
|
||||
case FilterOperatorIsEqual:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorIsNotEqual:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorContains:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorDoesNotContain:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorStartsWith:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorEndsWith:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: filter.Value.Block.Content}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: filter.Value.Block.Content, Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorIsEmpty:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
case FilterOperatorIsNotEmpty:
|
||||
ret.Block = &ValueBlock{ID: filter.Value.Block.ID, Content: ""}
|
||||
ret.Block = &ValueBlock{ID: addingBlockID, Content: "", Created: ret.CreatedAt, Updated: ret.UpdatedAt}
|
||||
}
|
||||
case KeyTypeText:
|
||||
switch filter.Operator {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue