1
0
Fork 0
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:
Harvey Kandola 2019-01-26 20:01:35 +00:00
parent 89a7496c7f
commit 5faf6bda9b
3 changed files with 6 additions and 7 deletions

View file

@ -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