This commit is contained in:
mr
2026-05-29 14:12:40 +02:00
parent a3bca24982
commit 82a4708f46
3 changed files with 6 additions and 0 deletions
+4
View File
@@ -98,6 +98,10 @@ func (r *AbstractObject) DeepCopy() *AbstractObject {
return &obj
}
func (r *AbstractObject) SetDraft(draft bool) {
r.IsDraft = draft
}
func (r *AbstractObject) SetName(name string) {
r.Name = name
}
+1
View File
@@ -109,6 +109,7 @@ func ModelGenericUpdateOne(change map[string]interface{}, id string, a Accessor)
obj := a.NewObj()
b, _ := json.Marshal(r)
json.Unmarshal(b, obj)
obj.SetDraft(change["is_draft"] == true)
if !a.GetRequest().Admin {
var ok bool
ok, r = r.CanUpdate(obj)
+1
View File
@@ -26,6 +26,7 @@ type DBObject interface {
GetID() string
GetName() string
SetName(name string)
SetDraft(draft bool)
IsDrafted() bool
CanDelete() bool
StoreDraftDefault()