Fix archiving namespaces

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-03-22 19:02:53 +01:00
parent c6d22bb1f8
commit 0a1887d6e7
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -453,7 +453,19 @@ func (n *Namespace) Update() (err error) {
}
}
// We need to specify the cols we want to update here to be able to un-archive lists
colsToUpdate := []string{
"name",
"is_archived",
}
if n.Description != "" {
colsToUpdate = append(colsToUpdate, "description")
}
// Do the actual update
_, err = x.ID(currentNamespace.ID).Update(n)
_, err = x.
ID(currentNamespace.ID).
Cols(colsToUpdate...).
Update(n)
return
}