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
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 13 additions and 1 deletions

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
}