Skip to content

Commit

Permalink
fix: gorm hard delete with Unscoped()
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Nov 28, 2018
1 parent 77182b5 commit 9af854e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -43,6 +43,8 @@ const Item = fragments.Contact(
} catch (err) {
console.error(err)
}
Item.isLoading[id] = false
this.forceUpdate()
}

onDecline = async () => {
Expand All @@ -54,6 +56,7 @@ const Item = fragments.Contact(
} catch (err) {
console.error(err)
}
Item.isLoading[id] = false
}

onRemove = async () => {
Expand All @@ -65,6 +68,7 @@ const Item = fragments.Contact(
} catch (err) {
console.error(err)
}
Item.isLoading[id] = false
}

render () {
Expand Down
2 changes: 1 addition & 1 deletion core/node/sql.go
Expand Up @@ -5,6 +5,6 @@ import "github.com/jinzhu/gorm"
// WithSQL registers a gorm connection as the node database
func WithSQL(sql *gorm.DB) NewNodeOption {
return func(n *Node) {
n.sql = sql
n.sql = sql.Unscoped()
}
}

0 comments on commit 9af854e

Please sign in to comment.