mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 12:58:08 -06:00
[bugfix] Fix new domain block date (#893)
This commit is contained in:
parent
f8528aa689
commit
5cf0f9950a
4 changed files with 11 additions and 14 deletions
|
|
@ -47,7 +47,7 @@ func normalizeDomain(domain string) (out string, err error) {
|
|||
return out, err
|
||||
}
|
||||
|
||||
func (d *domainDB) CreateDomainBlock(ctx context.Context, block gtsmodel.DomainBlock) db.Error {
|
||||
func (d *domainDB) CreateDomainBlock(ctx context.Context, block *gtsmodel.DomainBlock) db.Error {
|
||||
domain, err := normalizeDomain(block.Domain)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -56,13 +56,13 @@ func (d *domainDB) CreateDomainBlock(ctx context.Context, block gtsmodel.DomainB
|
|||
|
||||
// Attempt to insert new domain block
|
||||
if _, err := d.conn.NewInsert().
|
||||
Model(&block).
|
||||
Exec(ctx, &block); err != nil {
|
||||
Model(block).
|
||||
Exec(ctx); err != nil {
|
||||
return d.conn.ProcessError(err)
|
||||
}
|
||||
|
||||
// Cache this domain block
|
||||
d.cache.Put(block.Domain, &block)
|
||||
d.cache.Put(block.Domain, block)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue