1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 07:39:43 +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

View file

@ -311,5 +311,5 @@ type LabelStorer interface {
Get(ctx domain.RequestContext) (l []label.Label, err error)
Update(ctx domain.RequestContext, l label.Label) (err error)
Delete(ctx domain.RequestContext, id string) (rows int64, err error)
RemoveReference(ctx domain.RequestContext, spaceID string) (err error)
RemoveReference(ctx domain.RequestContext, labelID string) (err error)
}

View file

@ -13,6 +13,7 @@
padding: 10px;
}
}
.master-sidebar-container {
display: block;
height: auto;
@ -36,8 +37,6 @@
justify-content: space-between;
flex-wrap: wrap;
width: 100%;
// overflow-x: hidden;
// overflow-y: auto;
> .nav-options {
> .selected {
@ -130,7 +129,7 @@
}
// Tablet starts around 700px
@media (min-width: $display-break-1) and (min-height: 650px) {
@media (min-width: $display-break-1) {
.master-container {
display: grid;
grid-template-columns: 240px auto;