mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Remove label associations when deleting a label
This commit is contained in:
parent
89a7496c7f
commit
5faf6bda9b
3 changed files with 6 additions and 7 deletions
|
@ -89,11 +89,11 @@ func (s Store) Delete(ctx domain.RequestContext, id string) (rows int64, err err
|
|||
}
|
||||
|
||||
// RemoveReference clears space.labelID for given label.
|
||||
func (s Store) RemoveReference(ctx domain.RequestContext, spaceID string) (err error) {
|
||||
func (s Store) RemoveReference(ctx domain.RequestContext, labelID string) (err error) {
|
||||
_, err = ctx.Transaction.Exec(s.Bind(`UPDATE dmz_space SET
|
||||
c_labelid='', c_revised=?
|
||||
WHERE c_orgid=? AND c_refid=?`),
|
||||
time.Now().UTC(), ctx.OrgID, spaceID)
|
||||
WHERE c_orgid=? AND c_labelid=?`),
|
||||
time.Now().UTC(), ctx.OrgID, labelID)
|
||||
|
||||
if err == sql.ErrNoRows {
|
||||
err = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue